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/12 06:30:06 UTC
[shardingsphere-elasticjob-lite] branch master updated: Add
elasticjob-executor module (#1031)
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 848d2c7 Add elasticjob-executor module (#1031)
848d2c7 is described below
commit 848d2c76c83521378a7e728afc3f1e62b9e7c905
Author: Liang Zhang <te...@163.com>
AuthorDate: Sun Jul 12 14:29:59 2020 +0800
Add elasticjob-executor module (#1031)
* Remove JobFacade.isEligibleForJobRunning
* Refactor JobFacade.loadJobRootConfiguration
* Refactor CloudJobFacade
* Add JobTypeConfigurationUtil
* Decouple JobConfigurationContext and JobRootConfiguration
* Refactor JobConfigurationContext
* Add CloudJobFacade.loadJobConfiguration
* Refactor ElasticJobExecutor
* Add elasticjob-lite-executor-kernel module
* Rename elasticjob-lite-executor to elasticjob-executor
* Rename package name from elasticjob.lite.xxx.executor to elasticjob.xxx.executor
* Add elasticjob-executor-type module
* Remove lite dependency for executor module
* Remove ReflectionUtils
---
.../cloud/config/JobCoreConfiguration.java | 1 -
.../cloud/config/JobRootConfiguration.java | 2 +-
.../cloud/executor/AbstractElasticJobExecutor.java | 12 ++---
.../elasticjob/cloud/executor/JobFacade.java | 53 ++++++++++----------
.../cloud/executor/type/DataflowJobExecutor.java | 8 +--
.../cloud/executor/type/ScriptJobExecutor.java | 2 +-
.../cloud/config/JobCoreConfigurationTest.java | 5 --
.../cloud/executor/JobExecutorFactoryTest.java | 8 +--
.../executor/type/DataflowJobExecutorTest.java | 9 +---
.../cloud/executor/type/ScriptJobExecutorTest.java | 6 +--
.../cloud/executor/type/SimpleJobExecutorTest.java | 4 +-
.../cloud/executor/type/WrongJobExecutorTest.java | 2 +-
.../elasticjob/cloud/executor/CloudJobFacade.java | 24 +++++----
.../cloud/executor/DaemonTaskScheduler.java | 10 ++--
.../cloud/executor/JobConfigurationContext.java | 57 ++++------------------
...nContext.java => JobTypeConfigurationUtil.java} | 57 +++++++---------------
.../elasticjob/cloud/executor/TaskExecutor.java | 4 +-
.../cloud/executor/local/LocalTaskExecutor.java | 13 +++--
.../cloud/executor/CloudJobFacadeTest.java | 20 +-------
.../cloud/executor/DaemonTaskSchedulerTest.java | 7 +--
.../cloud/executor/TaskExecutorThreadTest.java | 10 ++--
.../elasticjob-executor-kernel}/pom.xml | 24 +++++++--
.../elasticjob}/executor/ElasticJobExecutor.java | 30 +++++-------
.../elasticjob}/executor/JobFacade.java | 4 +-
.../elasticjob}/executor/item/JobItemExecutor.java | 4 +-
.../executor/item/JobItemExecutorFactory.java | 6 +--
.../executor/item/impl/ClassedJobItemExecutor.java | 4 +-
.../executor/item/impl/TypedJobItemExecutor.java | 4 +-
.../executor/ElasticJobExecutorTest.java | 25 +++++-----
.../fixture/executor/ClassedFooJobExecutor.java | 10 ++--
.../fixture/executor/TypedFooJobExecutor.java | 8 +--
.../executor/fixture/job/DetailedFooJob.java | 16 ++++--
.../executor}/fixture/job/FailedJob.java | 2 +-
.../elasticjob/executor/fixture/job/FooJob.java | 11 ++---
.../executor/item/JobItemExecutorFactoryTest.java | 12 ++---
...sphere.elasticjob.executor.item.JobItemExecutor | 3 +-
.../elasticjob-dataflow-executor}/pom.xml | 6 +--
.../dataflow/executor/DataflowJobExecutor.java | 10 ++--
.../elasticjob}/dataflow/job/DataflowJob.java | 2 +-
.../dataflow/props/DataflowJobProperties.java | 2 +-
...sphere.elasticjob.executor.item.JobItemExecutor | 2 +-
.../elasticjob}/dataflow/job/BatchDataflowJob.java | 2 +-
.../dataflow/job/StreamingDataflowJob.java | 2 +-
.../elasticjob-script-executor}/pom.xml | 11 +++--
.../script/executor/ScriptJobExecutor.java | 8 +--
.../script/props/ScriptJobProperties.java | 2 +-
...sphere.elasticjob.executor.item.JobItemExecutor | 2 +-
.../elasticjob-simple-executor}/pom.xml | 6 +--
.../simple/executor/SimpleJobExecutor.java | 8 +--
.../elasticjob}/simple/job/SimpleJob.java | 2 +-
...sphere.elasticjob.executor.item.JobItemExecutor | 2 +-
.../elasticjob}/simple/job/FooSimpleJob.java | 2 +-
.../elasticjob-executor-type}/pom.xml | 10 ++--
.../pom.xml | 9 ++--
elasticjob-lite/elasticjob-lite-core/pom.xml | 10 ++--
.../elasticjob/lite/internal/schedule/LiteJob.java | 9 ++--
.../lite/internal/schedule/LiteJobFacade.java | 2 +-
.../fixture/executor/ClassedFooJobExecutor.java | 6 +--
...phere.elasticjob.executor.item.JobItemExecutor} | 1 -
...e.elasticjob.lite.executor.item.JobItemExecutor | 35 -------------
elasticjob-lite/elasticjob-lite-lifecycle/pom.xml | 6 +--
.../lite/lifecycle/fixture/TestDataflowJob.java | 2 +-
.../lite/lifecycle/fixture/TestSimpleJob.java | 2 +-
.../settings/JobConfigurationAPIImplTest.java | 4 +-
elasticjob-lite/elasticjob-lite-spring/pom.xml | 6 +--
.../spring/fixture/job/DataflowElasticJob.java | 2 +-
.../spring/fixture/job/FooSimpleElasticJob.java | 2 +-
.../fixture/job/ref/RefFooDataflowElasticJob.java | 2 +-
.../fixture/job/ref/RefFooSimpleElasticJob.java | 2 +-
elasticjob-lite/pom.xml | 1 -
examples/elasticjob-example-jobs/pom.xml | 6 +--
.../lite/example/job/dataflow/JavaDataflowJob.java | 2 +-
.../example/job/dataflow/SpringDataflowJob.java | 2 +-
.../lite/example/job/simple/JavaSimpleJob.java | 2 +-
.../lite/example/job/simple/SpringSimpleJob.java | 2 +-
.../elasticjob/lite/example/JavaMain.java | 4 +-
.../lite/example/config/DataflowJobConfig.java | 4 +-
.../lite/example/config/SimpleJobConfig.java | 2 +-
examples/pom.xml | 2 +-
pom.xml | 1 +
80 files changed, 289 insertions(+), 395 deletions(-)
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/JobCoreConfiguration.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/JobCoreConfiguration.java
index 72cf1f4..51fefcc 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/JobCoreConfiguration.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/JobCoreConfiguration.java
@@ -181,7 +181,6 @@ public final class JobCoreConfiguration {
*/
public final JobCoreConfiguration build() {
Preconditions.checkArgument(!Strings.isNullOrEmpty(jobName), "jobName can not be empty.");
- Preconditions.checkArgument(!Strings.isNullOrEmpty(cron), "cron can not be empty.");
Preconditions.checkArgument(shardingTotalCount > 0, "shardingTotalCount should larger than zero.");
return new JobCoreConfiguration(jobName, cron, shardingTotalCount, shardingItemParameters, jobParameter, failover, misfire, description, jobProperties);
}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/JobRootConfiguration.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/JobRootConfiguration.java
index 1be7357..ff3ae8e 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/JobRootConfiguration.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/JobRootConfiguration.java
@@ -21,7 +21,7 @@ package org.apache.shardingsphere.elasticjob.cloud.config;
* Job root configuration.
*/
public interface JobRootConfiguration {
-
+
/**
* Get type Configuration.
*
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 73fb5f9..d05f61a 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,7 +22,7 @@ import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.api.listener.ShardingContexts;
-import org.apache.shardingsphere.elasticjob.cloud.config.JobRootConfiguration;
+import org.apache.shardingsphere.elasticjob.cloud.config.JobTypeConfiguration;
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;
@@ -51,7 +51,7 @@ public abstract class AbstractElasticJobExecutor {
private final JobFacade jobFacade;
@Getter(AccessLevel.PROTECTED)
- private final JobRootConfiguration jobRootConfig;
+ private final JobTypeConfiguration jobConfig;
private final String jobName;
@@ -63,15 +63,15 @@ public abstract class AbstractElasticJobExecutor {
protected AbstractElasticJobExecutor(final JobFacade jobFacade) {
this.jobFacade = jobFacade;
- jobRootConfig = jobFacade.loadJobRootConfiguration(true);
- jobName = jobRootConfig.getTypeConfig().getCoreConfig().getJobName();
+ jobConfig = jobFacade.loadJobRootConfiguration(true);
+ jobName = jobConfig.getCoreConfig().getJobName();
executorService = ExecutorServiceHandlerRegistry.getExecutorServiceHandler(jobName, (ExecutorServiceHandler) getHandler(JobProperties.JobPropertiesEnum.EXECUTOR_SERVICE_HANDLER));
jobExceptionHandler = (JobExceptionHandler) getHandler(JobProperties.JobPropertiesEnum.JOB_EXCEPTION_HANDLER);
- itemErrorMessages = new ConcurrentHashMap<>(jobRootConfig.getTypeConfig().getCoreConfig().getShardingTotalCount(), 1);
+ itemErrorMessages = new ConcurrentHashMap<>(jobConfig.getCoreConfig().getShardingTotalCount(), 1);
}
private Object getHandler(final JobProperties.JobPropertiesEnum jobPropertiesEnum) {
- String handlerClassName = jobRootConfig.getTypeConfig().getCoreConfig().getJobProperties().get(jobPropertiesEnum);
+ String handlerClassName = jobConfig.getCoreConfig().getJobProperties().get(jobPropertiesEnum);
try {
Class<?> handlerClass = Class.forName(handlerClassName);
if (jobPropertiesEnum.getClassType().isAssignableFrom(handlerClass)) {
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 1a249e3..f6faf97 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
@@ -17,8 +17,9 @@
package org.apache.shardingsphere.elasticjob.cloud.executor;
+import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.api.listener.ShardingContexts;
-import org.apache.shardingsphere.elasticjob.cloud.config.JobRootConfiguration;
+import org.apache.shardingsphere.elasticjob.cloud.config.JobTypeConfiguration;
import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException;
import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State;
@@ -29,48 +30,56 @@ import java.util.Collection;
* Job facade.
*/
public interface JobFacade {
-
+
/**
* Load job root configuration.
*
* @param fromCache load from cache or not
* @return job root configuration
*/
- JobRootConfiguration loadJobRootConfiguration(boolean fromCache);
-
+ JobTypeConfiguration loadJobRootConfiguration(boolean fromCache);
+
+ /**
+ * Load job configuration.
+ *
+ * @param fromCache load from cache or not
+ * @return job configuration
+ */
+ JobConfiguration loadJobConfiguration(boolean fromCache);
+
/**
* check job execution environment.
*
* @throws JobExecutionEnvironmentException job execution environment exception
*/
void checkJobExecutionEnvironment() throws JobExecutionEnvironmentException;
-
+
/**
* Failover If necessary.
*/
void failoverIfNecessary();
-
+
/**
* Register job begin.
*
* @param shardingContexts sharding contexts
*/
void registerJobBegin(ShardingContexts shardingContexts);
-
+
/**
* Register job completed.
*
* @param shardingContexts sharding contexts
*/
void registerJobCompleted(ShardingContexts shardingContexts);
-
+
/**
* Get sharding contexts.
*
* @return sharding contexts
*/
ShardingContexts getShardingContexts();
-
+
/**
* Set task misfire flag.
*
@@ -78,14 +87,14 @@ public interface JobFacade {
* @return whether satisfy misfire condition
*/
boolean misfireIfRunning(Collection<Integer> shardingItems);
-
+
/**
* Clear misfire flag.
*
* @param shardingItems sharding items to be cleared misfire flag
*/
void clearMisfire(Collection<Integer> shardingItems);
-
+
/**
* Judge job whether need to execute misfire tasks.
*
@@ -93,47 +102,35 @@ public interface JobFacade {
* @return whether need to execute misfire tasks
*/
boolean isExecuteMisfired(Collection<Integer> shardingItems);
-
- /**
- * Judge job whether eligible running.
- *
- * <p>The ineligible job includes:
- * 1. Need to shutdown;
- * 2. Need to resharding;
- * 3. Not stream job.
- *
- * @return job is eligible running or not
- */
- boolean isEligibleForJobRunning();
-
+
/**
* Judge job whether need resharding.
*
* @return whether need resharding
*/
boolean isNeedSharding();
-
+
/**
* Call before job executed.
*
* @param shardingContexts sharding contexts
*/
void beforeJobExecuted(ShardingContexts shardingContexts);
-
+
/**
* Call after job executed.
*
* @param shardingContexts sharding contexts
*/
void afterJobExecuted(ShardingContexts shardingContexts);
-
+
/**
* Post job execution event.
*
* @param jobExecutionEvent job execution event
*/
void postJobExecutionEvent(JobExecutionEvent jobExecutionEvent);
-
+
/**
* Post job status trace event.
*
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/DataflowJobExecutor.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/DataflowJobExecutor.java
index e7a2c9e..e07f900 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/DataflowJobExecutor.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/DataflowJobExecutor.java
@@ -39,19 +39,19 @@ public final class DataflowJobExecutor extends AbstractElasticJobExecutor {
@Override
protected void process(final ShardingContext shardingContext) {
- DataflowJobConfiguration dataflowConfig = (DataflowJobConfiguration) getJobRootConfig().getTypeConfig();
+ DataflowJobConfiguration dataflowConfig = (DataflowJobConfiguration) getJobConfig();
if (dataflowConfig.isStreamingProcess()) {
- streamingExecute(shardingContext);
+ streamingExecute(shardingContext, dataflowConfig);
} else {
oneOffExecute(shardingContext);
}
}
- private void streamingExecute(final ShardingContext shardingContext) {
+ private void streamingExecute(final ShardingContext shardingContext, final DataflowJobConfiguration dataflowConfig) {
List<Object> data = fetchData(shardingContext);
while (null != data && !data.isEmpty()) {
processData(shardingContext, data);
- if (!getJobFacade().isEligibleForJobRunning()) {
+ if (!dataflowConfig.isStreamingProcess()) {
break;
}
data = fetchData(shardingContext);
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 05da56d..071ee00 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
@@ -40,7 +40,7 @@ public final class ScriptJobExecutor extends AbstractElasticJobExecutor {
@Override
protected void process(final ShardingContext shardingContext) {
- final String scriptCommandLine = ((ScriptJobConfiguration) getJobRootConfig().getTypeConfig()).getScriptCommandLine();
+ final String scriptCommandLine = ((ScriptJobConfiguration) getJobConfig()).getScriptCommandLine();
if (Strings.isNullOrEmpty(scriptCommandLine)) {
throw new JobConfigurationException("Cannot find script command line for job '%s', job is not executed.", shardingContext.getJobName());
}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/JobCoreConfigurationTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/JobCoreConfigurationTest.java
index a44ff4e..17390a7 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/JobCoreConfigurationTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/JobCoreConfigurationTest.java
@@ -79,11 +79,6 @@ public final class JobCoreConfigurationTest {
}
@Test(expected = IllegalArgumentException.class)
- public void assertBuildWhenCronIsNull() {
- JobCoreConfiguration.newBuilder("test_job", null, 3).build();
- }
-
- @Test(expected = IllegalArgumentException.class)
public void assertBuildWhenTotalSHardingCountIsNegative() {
JobCoreConfiguration.newBuilder(null, "0/1 * * * * ?", -1).build();
}
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 a7942f9..b3a650a 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
@@ -46,19 +46,19 @@ public final class JobExecutorFactoryTest {
@Test
public void assertGetJobExecutorForScriptJob() {
- when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestScriptJobConfiguration("test.sh", IgnoreJobExceptionHandler.class));
+ when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestScriptJobConfiguration("test.sh", IgnoreJobExceptionHandler.class).getTypeConfig());
assertThat(JobExecutorFactory.getJobExecutor(null, jobFacade), instanceOf(ScriptJobExecutor.class));
}
@Test
public void assertGetJobExecutorForSimpleJob() {
- when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestSimpleJobConfiguration());
+ when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestSimpleJobConfiguration().getTypeConfig());
assertThat(JobExecutorFactory.getJobExecutor(new TestSimpleJob(null), jobFacade), instanceOf(SimpleJobExecutor.class));
}
@Test
public void assertGetJobExecutorForDataflowJob() {
- when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestDataflowJobConfiguration(false));
+ when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestDataflowJobConfiguration(false).getTypeConfig());
assertThat(JobExecutorFactory.getJobExecutor(new TestDataflowJob(null), jobFacade), instanceOf(DataflowJobExecutor.class));
}
@@ -69,7 +69,7 @@ public final class JobExecutorFactoryTest {
@Test
public void assertGetJobExecutorTwice() {
- when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestDataflowJobConfiguration(false));
+ when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestDataflowJobConfiguration(false).getTypeConfig());
AbstractElasticJobExecutor executor = JobExecutorFactory.getJobExecutor(new TestSimpleJob(null), jobFacade);
AbstractElasticJobExecutor anotherExecutor = JobExecutorFactory.getJobExecutor(new TestSimpleJob(null), jobFacade);
assertTrue(executor.hashCode() != anotherExecutor.hashCode());
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/DataflowJobExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/DataflowJobExecutorTest.java
index e24c2c6..6fcc365 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/DataflowJobExecutorTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/DataflowJobExecutorTest.java
@@ -97,7 +97,6 @@ public final class DataflowJobExecutorTest {
public void assertExecuteWhenFetchDataIsNotEmptyForStreamingProcessAndSingleShardingItem() {
setUp(true, ShardingContextsBuilder.getSingleShardingContexts());
when(jobCaller.fetchData(0)).thenReturn(Collections.singletonList(1), Collections.emptyList());
- when(jobFacade.isEligibleForJobRunning()).thenReturn(true);
dataflowJobExecutor.execute();
verify(jobCaller, times(2)).fetchData(0);
verify(jobCaller).processData(1);
@@ -109,7 +108,6 @@ public final class DataflowJobExecutorTest {
setUp(true, ShardingContextsBuilder.getMultipleShardingContexts());
when(jobCaller.fetchData(0)).thenReturn(Collections.singletonList(1), Collections.emptyList());
when(jobCaller.fetchData(1)).thenReturn(Collections.singletonList(2), Collections.emptyList());
- when(jobFacade.isEligibleForJobRunning()).thenReturn(true);
dataflowJobExecutor.execute();
verify(jobCaller, times(2)).fetchData(0);
verify(jobCaller, times(2)).fetchData(1);
@@ -123,7 +121,6 @@ public final class DataflowJobExecutorTest {
setUp(true, ShardingContextsBuilder.getMultipleShardingContexts());
when(jobCaller.fetchData(0)).thenReturn(Collections.singletonList(1), Collections.emptyList());
when(jobCaller.fetchData(1)).thenReturn(Arrays.asList(2, 3), Collections.emptyList());
- when(jobFacade.isEligibleForJobRunning()).thenReturn(true);
doThrow(new IllegalStateException()).when(jobCaller).processData(2);
dataflowJobExecutor.execute();
verify(jobCaller, times(2)).fetchData(0);
@@ -137,7 +134,6 @@ public final class DataflowJobExecutorTest {
@Test
public void assertExecuteWhenFetchDataIsNotEmptyAndIsEligibleForJobRunningForStreamingProcess() {
setUp(true, ShardingContextsBuilder.getMultipleShardingContexts());
- when(jobFacade.isEligibleForJobRunning()).thenReturn(true);
when(jobCaller.fetchData(0)).thenReturn(Arrays.asList(1, 2), Collections.emptyList());
when(jobCaller.fetchData(1)).thenReturn(Arrays.asList(3, 4), Collections.emptyList());
doThrow(new IllegalStateException()).when(jobCaller).processData(4);
@@ -152,8 +148,7 @@ public final class DataflowJobExecutorTest {
@Test
public void assertExecuteWhenFetchDataIsNotEmptyAndIsNotEligibleForJobRunningForStreamingProcess() {
- setUp(true, ShardingContextsBuilder.getMultipleShardingContexts());
- when(jobFacade.isEligibleForJobRunning()).thenReturn(false);
+ setUp(false, ShardingContextsBuilder.getMultipleShardingContexts());
when(jobCaller.fetchData(0)).thenReturn(Arrays.asList(1, 2));
when(jobCaller.fetchData(1)).thenReturn(Arrays.asList(3, 4));
doThrow(new IllegalStateException()).when(jobCaller).processData(4);
@@ -168,7 +163,7 @@ public final class DataflowJobExecutorTest {
private void setUp(final boolean isStreamingProcess, final ShardingContexts shardingContexts) {
this.shardingContexts = shardingContexts;
- when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestDataflowJobConfiguration(isStreamingProcess));
+ when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestDataflowJobConfiguration(isStreamingProcess).getTypeConfig());
when(jobFacade.getShardingContexts()).thenReturn(shardingContexts);
dataflowJobExecutor = new DataflowJobExecutor(new TestDataflowJob(jobCaller), jobFacade);
ElasticJobVerify.prepareForIsNotMisfire(jobFacade, shardingContexts);
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 aa2cd18..3c3bf1c 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
@@ -43,7 +43,7 @@ public final class ScriptJobExecutorTest {
@Test
public void assertExecuteWhenCommandLineIsEmpty() {
ElasticJobVerify.prepareForIsNotMisfire(jobFacade, ShardingContextsBuilder.getMultipleShardingContexts());
- when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestScriptJobConfiguration("", IgnoreJobExceptionHandler.class));
+ when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestScriptJobConfiguration("", IgnoreJobExceptionHandler.class).getTypeConfig());
scriptJobExecutor = new ScriptJobExecutor(jobFacade);
scriptJobExecutor.execute();
}
@@ -60,7 +60,7 @@ public final class ScriptJobExecutorTest {
private void assertExecuteWhenExecuteFailure(final ShardingContexts shardingContexts) {
ElasticJobVerify.prepareForIsNotMisfire(jobFacade, shardingContexts);
- when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestScriptJobConfiguration("not_exists_file", ThrowJobExceptionHandler.class));
+ when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestScriptJobConfiguration("not_exists_file", ThrowJobExceptionHandler.class).getTypeConfig());
scriptJobExecutor = new ScriptJobExecutor(jobFacade);
scriptJobExecutor.execute();
}
@@ -77,7 +77,7 @@ public final class ScriptJobExecutorTest {
private void assertExecuteSuccess(final ShardingContexts shardingContexts) {
ElasticJobVerify.prepareForIsNotMisfire(jobFacade, shardingContexts);
- when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestScriptJobConfiguration("exists_file param0 param1", IgnoreJobExceptionHandler.class));
+ when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestScriptJobConfiguration("exists_file param0 param1", IgnoreJobExceptionHandler.class).getTypeConfig());
scriptJobExecutor = new ScriptJobExecutor(jobFacade);
scriptJobExecutor.execute();
verify(jobFacade).loadJobRootConfiguration(true);
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 d7e3712..2fd8221 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
@@ -58,13 +58,13 @@ public final class SimpleJobExecutorTest {
@Before
public void setUp() {
- when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestSimpleJobConfiguration());
+ when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestSimpleJobConfiguration().getTypeConfig());
simpleJobExecutor = new SimpleJobExecutor(new TestSimpleJob(jobCaller), jobFacade);
}
@Test
public void assertNewExecutorWithDefaultHandlers() throws NoSuchFieldException {
- when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestSimpleJobConfiguration("ErrorHandler", Object.class.getName()));
+ when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestSimpleJobConfiguration("ErrorHandler", Object.class.getName()).getTypeConfig());
SimpleJobExecutor simpleJobExecutor = new SimpleJobExecutor(new TestSimpleJob(jobCaller), jobFacade);
assertThat(ReflectionUtils.getFieldValue(simpleJobExecutor, AbstractElasticJobExecutor.class.getDeclaredField("executorService")),
instanceOf(new DefaultExecutorServiceHandler().createExecutorService("test_job").getClass()));
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/WrongJobExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/WrongJobExecutorTest.java
index 0f0244d..95ac786 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/WrongJobExecutorTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/WrongJobExecutorTest.java
@@ -44,7 +44,7 @@ public final class WrongJobExecutorTest {
@Before
public void setUp() {
- when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestSimpleJobConfiguration());
+ when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestSimpleJobConfiguration().getTypeConfig());
wrongSimpleJobExecutor = new SimpleJobExecutor(new TestWrongJob(), jobFacade);
}
diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/CloudJobFacade.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/CloudJobFacade.java
index d3d8de5..939b83f 100755
--- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/CloudJobFacade.java
+++ b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/CloudJobFacade.java
@@ -18,9 +18,10 @@
package org.apache.shardingsphere.elasticjob.cloud.executor;
import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.api.listener.ShardingContexts;
-import org.apache.shardingsphere.elasticjob.cloud.config.JobRootConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.config.dataflow.DataflowJobConfiguration;
+import org.apache.shardingsphere.elasticjob.cloud.config.JobTypeConfiguration;
+import org.apache.shardingsphere.elasticjob.cloud.executor.handler.JobProperties.JobPropertiesEnum;
import org.apache.shardingsphere.elasticjob.infra.context.TaskContext;
import org.apache.shardingsphere.elasticjob.tracing.JobEventBus;
import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
@@ -38,16 +39,26 @@ public final class CloudJobFacade implements JobFacade {
private final ShardingContexts shardingContexts;
- private final JobConfigurationContext jobConfig;
+ private final JobTypeConfiguration jobConfig;
private final JobEventBus jobEventBus;
@Override
- public JobRootConfiguration loadJobRootConfiguration(final boolean fromCache) {
+ public JobTypeConfiguration loadJobRootConfiguration(final boolean fromCache) {
return jobConfig;
}
@Override
+ public JobConfiguration loadJobConfiguration(final boolean fromCache) {
+ return JobConfiguration.newBuilder(jobConfig.getCoreConfig().getJobName(), jobConfig.getCoreConfig().getShardingTotalCount())
+ .cron(jobConfig.getCoreConfig().getCron()).shardingItemParameters(jobConfig.getCoreConfig().getShardingItemParameters()).jobParameter(jobConfig.getCoreConfig().getJobParameter())
+ .failover(jobConfig.getCoreConfig().isFailover()).misfire(jobConfig.getCoreConfig().isMisfire()).description(jobConfig.getCoreConfig().getDescription())
+ .jobExecutorServiceHandlerType(jobConfig.getCoreConfig().getJobProperties().get(JobPropertiesEnum.EXECUTOR_SERVICE_HANDLER))
+ .jobErrorHandlerType(jobConfig.getCoreConfig().getJobProperties().get(JobPropertiesEnum.JOB_EXCEPTION_HANDLER)).build();
+
+ }
+
+ @Override
public void checkJobExecutionEnvironment() {
}
@@ -83,11 +94,6 @@ public final class CloudJobFacade implements JobFacade {
}
@Override
- public boolean isEligibleForJobRunning() {
- return jobConfig.getTypeConfig() instanceof DataflowJobConfiguration && ((DataflowJobConfiguration) jobConfig.getTypeConfig()).isStreamingProcess();
- }
-
- @Override
public boolean isNeedSharding() {
return false;
}
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 9e1b5df..d6ed6d7 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.api.listener.ShardingContexts;
import org.apache.shardingsphere.elasticjob.cloud.api.ElasticJob;
-import org.apache.shardingsphere.elasticjob.cloud.config.JobRootConfiguration;
+import org.apache.shardingsphere.elasticjob.cloud.config.JobCoreConfiguration;
import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException;
import org.quartz.CronScheduleBuilder;
import org.quartz.CronTrigger;
@@ -58,7 +58,7 @@ public final class DaemonTaskScheduler {
private final ElasticJob elasticJob;
- private final JobRootConfiguration jobRootConfig;
+ private final JobCoreConfiguration jobConfig;
private final JobFacade jobFacade;
@@ -70,13 +70,13 @@ public final class DaemonTaskScheduler {
* Init the job.
*/
public void init() {
- JobDetail jobDetail = JobBuilder.newJob(DaemonJob.class).withIdentity(jobRootConfig.getTypeConfig().getCoreConfig().getJobName()).build();
+ JobDetail jobDetail = JobBuilder.newJob(DaemonJob.class).withIdentity(jobConfig.getJobName()).build();
jobDetail.getJobDataMap().put(ELASTIC_JOB_DATA_MAP_KEY, elasticJob);
jobDetail.getJobDataMap().put(JOB_FACADE_DATA_MAP_KEY, jobFacade);
jobDetail.getJobDataMap().put(EXECUTOR_DRIVER_DATA_MAP_KEY, executorDriver);
jobDetail.getJobDataMap().put(TASK_ID_DATA_MAP_KEY, taskId);
try {
- scheduleJob(initializeScheduler(), jobDetail, taskId.getValue(), jobRootConfig.getTypeConfig().getCoreConfig().getCron());
+ scheduleJob(initializeScheduler(), jobDetail, taskId.getValue(), jobConfig.getCron());
} catch (final SchedulerException ex) {
throw new JobSystemException(ex);
}
@@ -93,7 +93,7 @@ public final class DaemonTaskScheduler {
result.put("org.quartz.threadPool.class", org.quartz.simpl.SimpleThreadPool.class.getName());
result.put("org.quartz.threadPool.threadCount", "1");
result.put("org.quartz.scheduler.instanceName", taskId.getValue());
- if (!jobRootConfig.getTypeConfig().getCoreConfig().isMisfire()) {
+ if (!jobConfig.isMisfire()) {
result.put("org.quartz.jobStore.misfireThreshold", "1");
}
result.put("org.quartz.plugin.shutdownhook.class", ShutdownHookPlugin.class.getName());
diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobConfigurationContext.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobConfigurationContext.java
index 4c8d37c..21990e2 100755
--- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobConfigurationContext.java
+++ b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobConfigurationContext.java
@@ -17,69 +17,30 @@
package org.apache.shardingsphere.elasticjob.cloud.executor;
-import org.apache.shardingsphere.elasticjob.cloud.api.JobType;
-import org.apache.shardingsphere.elasticjob.cloud.config.JobCoreConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.config.JobRootConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.config.JobTypeConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.config.script.ScriptJobConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.config.dataflow.DataflowJobConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.config.simple.SimpleJobConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.executor.handler.JobProperties.JobPropertiesEnum;
-import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import lombok.Getter;
+import org.apache.shardingsphere.elasticjob.cloud.config.JobTypeConfiguration;
import java.util.Map;
/**
* Job configuration context.
*/
-public final class JobConfigurationContext implements JobRootConfiguration {
+@Getter
+public final class JobConfigurationContext {
- private static final String IGNORE_CRON = "ignoredCron";
+ private final JobTypeConfiguration typeConfig;
- private JobTypeConfiguration jobTypeConfig;
+ private final String beanName;
- @Getter
- private String beanName;
+ private final String applicationContext;
- @Getter
- private String applicationContext;
+ private final boolean isTransient;
public JobConfigurationContext(final Map<String, String> jobConfigurationMap) {
- int ignoredShardingTotalCount = 1;
- String jobClass = jobConfigurationMap.get("jobClass");
- String jobType = jobConfigurationMap.get("jobType");
- String jobName = jobConfigurationMap.get("jobName");
- String cron = Strings.isNullOrEmpty(jobConfigurationMap.get("cron")) ? IGNORE_CRON : jobConfigurationMap.get("cron");
- Preconditions.checkArgument(!Strings.isNullOrEmpty(jobName), "jobName can not be empty.");
- Preconditions.checkArgument(!Strings.isNullOrEmpty(jobType), "jobType can not be empty.");
- Preconditions.checkArgument(!Strings.isNullOrEmpty(jobClass), "jobClass can not be empty.");
- JobCoreConfiguration jobCoreConfig = JobCoreConfiguration.newBuilder(jobName, cron, ignoredShardingTotalCount).build();
- jobCoreConfig.getJobProperties().put(JobPropertiesEnum.EXECUTOR_SERVICE_HANDLER.name(), jobConfigurationMap.get("executorServiceHandler"));
- jobCoreConfig.getJobProperties().put(JobPropertiesEnum.JOB_EXCEPTION_HANDLER.name(), jobConfigurationMap.get("jobExceptionHandler"));
- if (JobType.DATAFLOW.name().equals(jobType)) {
- jobTypeConfig = new DataflowJobConfiguration(jobCoreConfig, jobClass, Boolean.valueOf(jobConfigurationMap.get("streamingProcess")));
- } else if (JobType.SIMPLE.name().equals(jobType)) {
- jobTypeConfig = new SimpleJobConfiguration(jobCoreConfig, jobClass);
- } else if (JobType.SCRIPT.name().equals(jobType)) {
- jobTypeConfig = new ScriptJobConfiguration(jobCoreConfig, jobConfigurationMap.get("scriptCommandLine"));
- }
+ typeConfig = JobTypeConfigurationUtil.createJobConfigurationContext(jobConfigurationMap);
beanName = jobConfigurationMap.get("beanName");
applicationContext = jobConfigurationMap.get("applicationContext");
- }
-
- /**
- * Whether is transient job.
- *
- * @return true is transient job, otherwise not
- */
- public boolean isTransient() {
- return IGNORE_CRON.equals(jobTypeConfig.getCoreConfig().getCron());
- }
-
- @Override
- public JobTypeConfiguration getTypeConfig() {
- return jobTypeConfig;
+ isTransient = Strings.isNullOrEmpty(typeConfig.getCoreConfig().getCron());
}
}
diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobConfigurationContext.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobTypeConfigurationUtil.java
old mode 100755
new mode 100644
similarity index 64%
copy from elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobConfigurationContext.java
copy to elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobTypeConfigurationUtil.java
index 4c8d37c..e9872f0
--- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobConfigurationContext.java
+++ b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobTypeConfigurationUtil.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.
@@ -17,41 +17,35 @@
package org.apache.shardingsphere.elasticjob.cloud.executor;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
import org.apache.shardingsphere.elasticjob.cloud.api.JobType;
import org.apache.shardingsphere.elasticjob.cloud.config.JobCoreConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.config.JobRootConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.config.JobTypeConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.config.script.ScriptJobConfiguration;
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.executor.handler.JobProperties.JobPropertiesEnum;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
-import lombok.Getter;
import java.util.Map;
/**
- * Job configuration context.
+ * Job type configuration utility.
*/
-public final class JobConfigurationContext implements JobRootConfiguration {
-
- private static final String IGNORE_CRON = "ignoredCron";
-
- private JobTypeConfiguration jobTypeConfig;
-
- @Getter
- private String beanName;
+public final class JobTypeConfigurationUtil {
- @Getter
- private String applicationContext;
-
- public JobConfigurationContext(final Map<String, String> jobConfigurationMap) {
+ /**
+ * Create job configuration context.
+ *
+ * @param jobConfigurationMap job configuration map
+ * @return job type configuration
+ */
+ public static JobTypeConfiguration createJobConfigurationContext(final Map<String, String> jobConfigurationMap) {
int ignoredShardingTotalCount = 1;
String jobClass = jobConfigurationMap.get("jobClass");
String jobType = jobConfigurationMap.get("jobType");
String jobName = jobConfigurationMap.get("jobName");
- String cron = Strings.isNullOrEmpty(jobConfigurationMap.get("cron")) ? IGNORE_CRON : jobConfigurationMap.get("cron");
+ String cron = jobConfigurationMap.get("cron");
Preconditions.checkArgument(!Strings.isNullOrEmpty(jobName), "jobName can not be empty.");
Preconditions.checkArgument(!Strings.isNullOrEmpty(jobType), "jobType can not be empty.");
Preconditions.checkArgument(!Strings.isNullOrEmpty(jobClass), "jobClass can not be empty.");
@@ -59,27 +53,10 @@ public final class JobConfigurationContext implements JobRootConfiguration {
jobCoreConfig.getJobProperties().put(JobPropertiesEnum.EXECUTOR_SERVICE_HANDLER.name(), jobConfigurationMap.get("executorServiceHandler"));
jobCoreConfig.getJobProperties().put(JobPropertiesEnum.JOB_EXCEPTION_HANDLER.name(), jobConfigurationMap.get("jobExceptionHandler"));
if (JobType.DATAFLOW.name().equals(jobType)) {
- jobTypeConfig = new DataflowJobConfiguration(jobCoreConfig, jobClass, Boolean.valueOf(jobConfigurationMap.get("streamingProcess")));
- } else if (JobType.SIMPLE.name().equals(jobType)) {
- jobTypeConfig = new SimpleJobConfiguration(jobCoreConfig, jobClass);
+ return new DataflowJobConfiguration(jobCoreConfig, jobClass, Boolean.valueOf(jobConfigurationMap.get("streamingProcess")));
} else if (JobType.SCRIPT.name().equals(jobType)) {
- jobTypeConfig = new ScriptJobConfiguration(jobCoreConfig, jobConfigurationMap.get("scriptCommandLine"));
+ return new ScriptJobConfiguration(jobCoreConfig, jobConfigurationMap.get("scriptCommandLine"));
}
- beanName = jobConfigurationMap.get("beanName");
- applicationContext = jobConfigurationMap.get("applicationContext");
- }
-
- /**
- * Whether is transient job.
- *
- * @return true is transient job, otherwise not
- */
- public boolean isTransient() {
- return IGNORE_CRON.equals(jobTypeConfig.getCoreConfig().getCron());
- }
-
- @Override
- public JobTypeConfiguration getTypeConfig() {
- return jobTypeConfig;
+ return new SimpleJobConfiguration(jobCoreConfig, jobClass);
}
}
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 84b72cc..d8b8fef 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
@@ -123,12 +123,12 @@ public final class TaskExecutor implements Executor {
JobConfigurationContext jobConfig = new JobConfigurationContext((Map<String, String>) data.get("jobConfigContext"));
try {
ElasticJob elasticJob = getElasticJobInstance(jobConfig);
- final CloudJobFacade jobFacade = new CloudJobFacade(shardingContexts, jobConfig, jobEventBus);
+ final CloudJobFacade jobFacade = new CloudJobFacade(shardingContexts, jobConfig.getTypeConfig(), jobEventBus);
if (jobConfig.isTransient()) {
JobExecutorFactory.getJobExecutor(elasticJob, jobFacade).execute();
executorDriver.sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(Protos.TaskState.TASK_FINISHED).build());
} else {
- new DaemonTaskScheduler(elasticJob, jobConfig, jobFacade, executorDriver, taskInfo.getTaskId()).init();
+ new DaemonTaskScheduler(elasticJob, jobConfig.getTypeConfig().getCoreConfig(), jobFacade, executorDriver, taskInfo.getTaskId()).init();
}
// CHECKSTYLE:OFF
} catch (final Throwable 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 4d92a71..2b3068c 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
@@ -26,11 +26,12 @@ import org.apache.shardingsphere.elasticjob.cloud.api.JobType;
import org.apache.shardingsphere.elasticjob.cloud.api.dataflow.DataflowJob;
import org.apache.shardingsphere.elasticjob.cloud.api.simple.SimpleJob;
import org.apache.shardingsphere.elasticjob.cloud.config.JobCoreConfiguration;
+import org.apache.shardingsphere.elasticjob.cloud.config.JobTypeConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.config.dataflow.DataflowJobConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.config.script.ScriptJobConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.executor.AbstractElasticJobExecutor;
import org.apache.shardingsphere.elasticjob.cloud.executor.CloudJobFacade;
-import org.apache.shardingsphere.elasticjob.cloud.executor.JobConfigurationContext;
+import org.apache.shardingsphere.elasticjob.cloud.executor.JobTypeConfigurationUtil;
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;
@@ -43,7 +44,7 @@ import java.util.HashMap;
import java.util.Map;
/**
- * Task executor.
+ * Local task executor.
*/
@RequiredArgsConstructor
public final class LocalTaskExecutor {
@@ -56,7 +57,7 @@ public final class LocalTaskExecutor {
@SuppressWarnings("unchecked")
public void execute() {
AbstractElasticJobExecutor jobExecutor;
- CloudJobFacade jobFacade = new CloudJobFacade(getShardingContexts(), getJobConfigurationContext(), new JobEventBus());
+ CloudJobFacade jobFacade = new CloudJobFacade(getShardingContexts(), getJobTypeConfiguration(), new JobEventBus());
switch (localCloudJobConfiguration.getTypeConfig().getJobType()) {
case SIMPLE:
jobExecutor = new SimpleJobExecutor(getJobInstance(SimpleJob.class), jobFacade);
@@ -82,19 +83,17 @@ public final class LocalTaskExecutor {
localCloudJobConfiguration.getJobName(), coreConfig.getShardingTotalCount(), coreConfig.getJobParameter(), shardingItemMap);
}
- private JobConfigurationContext getJobConfigurationContext() {
+ private JobTypeConfiguration getJobTypeConfiguration() {
Map<String, String> jobConfigurationMap = new HashMap<>();
jobConfigurationMap.put("jobClass", localCloudJobConfiguration.getTypeConfig().getJobClass());
jobConfigurationMap.put("jobType", localCloudJobConfiguration.getTypeConfig().getJobType().name());
jobConfigurationMap.put("jobName", localCloudJobConfiguration.getJobName());
- jobConfigurationMap.put("beanName", localCloudJobConfiguration.getBeanName());
- jobConfigurationMap.put("applicationContext", localCloudJobConfiguration.getApplicationContext());
if (JobType.DATAFLOW == localCloudJobConfiguration.getTypeConfig().getJobType()) {
jobConfigurationMap.put("streamingProcess", Boolean.toString(((DataflowJobConfiguration) localCloudJobConfiguration.getTypeConfig()).isStreamingProcess()));
} else if (JobType.SCRIPT == localCloudJobConfiguration.getTypeConfig().getJobType()) {
jobConfigurationMap.put("scriptCommandLine", ((ScriptJobConfiguration) localCloudJobConfiguration.getTypeConfig()).getScriptCommandLine());
}
- return new JobConfigurationContext(jobConfigurationMap);
+ return JobTypeConfigurationUtil.createJobConfigurationContext(jobConfigurationMap);
}
private <T extends ElasticJob> T getJobInstance(final Class<T> clazz) {
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 974c478..3c76b9a 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
@@ -37,7 +37,6 @@ import java.util.Map;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.verify;
@RunWith(MockitoJUnitRunner.class)
@@ -56,7 +55,7 @@ public class CloudJobFacadeTest {
public void setUp() {
shardingContexts = getShardingContexts();
jobConfig = new JobConfigurationContext(getJobConfigurationMap(JobType.SIMPLE, false));
- jobFacade = new CloudJobFacade(shardingContexts, jobConfig, eventBus);
+ jobFacade = new CloudJobFacade(shardingContexts, jobConfig.getTypeConfig(), eventBus);
}
private ShardingContexts getShardingContexts() {
@@ -76,7 +75,7 @@ public class CloudJobFacadeTest {
@Test
public void assertLoadJobRootConfiguration() {
- assertThat(jobFacade.loadJobRootConfiguration(true), is(jobConfig));
+ assertThat(jobFacade.loadJobRootConfiguration(true), is(jobConfig.getTypeConfig()));
}
@Test
@@ -120,21 +119,6 @@ public class CloudJobFacadeTest {
}
@Test
- public void assertIsEligibleForJobRunningWhenIsNotDataflowJob() {
- assertFalse(jobFacade.isEligibleForJobRunning());
- }
-
- @Test
- public void assertIsEligibleForJobRunningWhenIsDataflowJobAndIsNotStreamingProcess() {
- assertFalse(new CloudJobFacade(shardingContexts, new JobConfigurationContext(getJobConfigurationMap(JobType.DATAFLOW, false)), new JobEventBus()).isEligibleForJobRunning());
- }
-
- @Test
- public void assertIsEligibleForJobRunningWhenIsDataflowJobAndIsStreamingProcess() {
- assertTrue(new CloudJobFacade(shardingContexts, new JobConfigurationContext(getJobConfigurationMap(JobType.DATAFLOW, true)), new JobEventBus()).isEligibleForJobRunning());
- }
-
- @Test
public void assertIsNeedSharding() {
assertFalse(jobFacade.isNeedSharding());
}
diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/DaemonTaskSchedulerTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/DaemonTaskSchedulerTest.java
index aabd42e..1e787d9 100755
--- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/DaemonTaskSchedulerTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/DaemonTaskSchedulerTest.java
@@ -47,9 +47,6 @@ public final class DaemonTaskSchedulerTest {
private JobExecutionContext jobExecutionContext;
@Mock
- private AbstractElasticJobExecutor jobExecutor;
-
- @Mock
private ShardingContexts shardingContexts;
private TaskID taskId = TaskID.newBuilder().setValue(String.format("%s@-@0@-@%s@-@fake_slave_id@-@0", "test_job", ExecutionType.READY)).build();
@@ -68,7 +65,7 @@ public final class DaemonTaskSchedulerTest {
@Test
public void assertJobRun() {
when(jobFacade.getShardingContexts()).thenReturn(shardingContexts);
- when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestScriptJobConfiguration("test.sh"));
+ when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestScriptJobConfiguration("test.sh").getTypeConfig());
daemonJob.execute(jobExecutionContext);
verify(shardingContexts).setAllowSendJobEvent(true);
verify(executorDriver).sendStatusUpdate(TaskStatus.newBuilder().setTaskId(taskId).setState(TaskState.TASK_RUNNING).setMessage("BEGIN").build());
@@ -80,7 +77,7 @@ public final class DaemonTaskSchedulerTest {
public void assertJobRunWithEventSampling() {
when(shardingContexts.getJobEventSamplingCount()).thenReturn(2);
when(jobFacade.getShardingContexts()).thenReturn(shardingContexts);
- when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestScriptJobConfiguration("test.sh"));
+ when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestScriptJobConfiguration("test.sh").getTypeConfig());
daemonJob.execute(jobExecutionContext);
verify(shardingContexts).setCurrentJobEventSamplingCount(1);
verify(shardingContexts).setAllowSendJobEvent(false);
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 0e93dce..c975f8f 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
@@ -58,7 +58,7 @@ public final class TaskExecutorThreadTest {
verify(executorDriver).sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(TaskState.TASK_RUNNING).build());
verify(executorDriver).sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(TaskState.TASK_FINISHED).build());
}
-
+
@Test
public void assertLaunchTaskWithTransientTaskAndSpringSimpleJob() {
TaskInfo taskInfo = buildSpringDaemonTaskInfo();
@@ -99,11 +99,11 @@ public final class TaskExecutorThreadTest {
}
private TaskInfo buildWrongClass() {
- return buildTaskInfo(buildBaseJobConfigurationContextMapWithJobClassAndCron("WrongClass", "ignoredCron")).build();
+ return buildTaskInfo(buildBaseJobConfigurationContextMapWithJobClassAndCron("WrongClass", null)).build();
}
private TaskInfo buildWrongElasticJobClass() {
- return buildTaskInfo(buildBaseJobConfigurationContextMapWithJobClassAndCron(TaskExecutorThreadTest.class.getCanonicalName(), "ignoredCron")).build();
+ return buildTaskInfo(buildBaseJobConfigurationContextMapWithJobClassAndCron(TaskExecutorThreadTest.class.getCanonicalName(), null)).build();
}
private TaskInfo buildSpringDaemonTaskInfo() {
@@ -111,11 +111,11 @@ public final class TaskExecutorThreadTest {
}
private TaskInfo buildJavaTransientTaskInfo() {
- return buildTaskInfo(buildBaseJobConfigurationContextMapWithJobClassAndCron(TestJob.class.getCanonicalName(), "ignoredCron")).build();
+ return buildTaskInfo(buildBaseJobConfigurationContextMapWithJobClassAndCron(TestJob.class.getCanonicalName(), null)).build();
}
private TaskInfo buildSpringScriptTransientTaskInfo() {
- return buildTaskInfo(buildBaseJobConfigurationContextMap(TestJob.class.getCanonicalName(), "ignoredCron", JobType.SCRIPT)).build();
+ return buildTaskInfo(buildBaseJobConfigurationContextMap(TestJob.class.getCanonicalName(), null, JobType.SCRIPT)).build();
}
private TaskInfo.Builder buildTaskInfo(final Map<String, String> jobConfigurationContext) {
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/pom.xml b/elasticjob-executor/elasticjob-executor-kernel/pom.xml
similarity index 66%
copy from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/pom.xml
copy to elasticjob-executor/elasticjob-executor-kernel/pom.xml
index a51d220..e826ddb 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/pom.xml
+++ b/elasticjob-executor/elasticjob-executor-kernel/pom.xml
@@ -22,16 +22,26 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-executor</artifactId>
+ <artifactId>elasticjob-executor</artifactId>
<version>3.0.0.M1-SNAPSHOT</version>
</parent>
- <artifactId>elasticjob-lite-script-executor</artifactId>
+ <artifactId>elasticjob-executor-kernel</artifactId>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-core</artifactId>
+ <artifactId>elasticjob-api</artifactId>
+ <version>${project.parent.version}</version>
+ </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-tracing-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
@@ -44,5 +54,13 @@
<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>
</dependencies>
</project>
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/ElasticJobExecutor.java b/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java
similarity index 82%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/ElasticJobExecutor.java
rename to elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java
index 219cf2a..31b565f 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/ElasticJobExecutor.java
+++ b/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,30 +15,25 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.executor;
+package org.apache.shardingsphere.elasticjob.executor;
import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.api.listener.ElasticJobListener;
import org.apache.shardingsphere.elasticjob.api.listener.ShardingContexts;
+import org.apache.shardingsphere.elasticjob.infra.env.IpUtils;
import org.apache.shardingsphere.elasticjob.infra.exception.ExceptionUtils;
import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException;
-import org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor;
-import org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutorFactory;
import org.apache.shardingsphere.elasticjob.infra.handler.error.JobErrorHandler;
import org.apache.shardingsphere.elasticjob.infra.handler.error.JobErrorHandlerFactory;
import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandlerFactory;
-import org.apache.shardingsphere.elasticjob.lite.internal.schedule.LiteJobFacade;
-import org.apache.shardingsphere.elasticjob.infra.env.IpUtils;
-import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
+import org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor;
+import org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutorFactory;
import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent.ExecutionSource;
import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State;
import java.util.Collection;
-import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
@@ -64,22 +59,19 @@ public final class ElasticJobExecutor {
private final Map<Integer, String> itemErrorMessages;
- public ElasticJobExecutor(final CoordinatorRegistryCenter regCenter,
- final ElasticJob elasticJob, final JobConfiguration jobConfig, final List<ElasticJobListener> elasticJobListeners, final TracingConfiguration tracingConfig) {
- this(regCenter, elasticJob, jobConfig, elasticJobListeners, tracingConfig, JobItemExecutorFactory.getExecutor(elasticJob.getClass()));
+ public ElasticJobExecutor(final ElasticJob elasticJob, final JobConfiguration jobConfig, final JobFacade jobFacade) {
+ this(elasticJob, jobConfig, jobFacade, JobItemExecutorFactory.getExecutor(elasticJob.getClass()));
}
- public ElasticJobExecutor(final CoordinatorRegistryCenter regCenter,
- final String type, final JobConfiguration jobConfig, final List<ElasticJobListener> elasticJobListeners, final TracingConfiguration tracingConfig) {
- this(regCenter, null, jobConfig, elasticJobListeners, tracingConfig, JobItemExecutorFactory.getExecutor(type));
+ public ElasticJobExecutor(final String type, final JobConfiguration jobConfig, final JobFacade jobFacade) {
+ this(null, jobConfig, jobFacade, JobItemExecutorFactory.getExecutor(type));
}
- private ElasticJobExecutor(final CoordinatorRegistryCenter regCenter, final ElasticJob elasticJob, final JobConfiguration jobConfig,
- final List<ElasticJobListener> elasticJobListeners, final TracingConfiguration tracingConfig, final JobItemExecutor jobItemExecutor) {
+ private ElasticJobExecutor(final ElasticJob elasticJob, final JobConfiguration jobConfig, final JobFacade jobFacade, final JobItemExecutor jobItemExecutor) {
this.elasticJob = elasticJob;
this.jobConfig = jobConfig;
+ this.jobFacade = jobFacade;
this.jobItemExecutor = jobItemExecutor;
- jobFacade = new LiteJobFacade(regCenter, jobConfig.getJobName(), elasticJobListeners, tracingConfig);
executorService = JobExecutorServiceHandlerFactory.getHandler(jobConfig.getJobExecutorServiceHandlerType()).createExecutorService(jobConfig.getJobName());
jobErrorHandler = JobErrorHandlerFactory.getHandler(jobConfig.getJobErrorHandlerType());
itemErrorMessages = new ConcurrentHashMap<>(jobConfig.getShardingTotalCount(), 1);
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/JobFacade.java b/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java
similarity index 98%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/JobFacade.java
rename to elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java
index 948e565..6d0c79b 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/JobFacade.java
+++ b/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.executor;
+package org.apache.shardingsphere.elasticjob.executor;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.api.listener.ShardingContexts;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutor.java b/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java
similarity index 91%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutor.java
rename to elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java
index 8ec99d4..f95d40d 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutor.java
+++ b/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java
@@ -15,12 +15,12 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.executor.item;
+package org.apache.shardingsphere.elasticjob.executor.item;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.executor.JobFacade;
+import org.apache.shardingsphere.elasticjob.executor.JobFacade;
/**
* Job item executor.
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutorFactory.java b/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java
similarity index 93%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutorFactory.java
rename to elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java
index c693774..82029ba 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutorFactory.java
+++ b/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java
@@ -15,14 +15,14 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.executor.item;
+package org.apache.shardingsphere.elasticjob.executor.item;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException;
-import org.apache.shardingsphere.elasticjob.lite.executor.item.impl.ClassedJobItemExecutor;
-import org.apache.shardingsphere.elasticjob.lite.executor.item.impl.TypedJobItemExecutor;
+import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor;
+import org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor;
import java.util.Map;
import java.util.Map.Entry;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/impl/ClassedJobItemExecutor.java b/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java
similarity index 88%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/impl/ClassedJobItemExecutor.java
rename to elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java
index 5cd7184..dd77a90 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/impl/ClassedJobItemExecutor.java
+++ b/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.executor.item.impl;
+package org.apache.shardingsphere.elasticjob.executor.item.impl;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
-import org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor;
+import org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor;
/**
* Classed job item executor.
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/impl/TypedJobItemExecutor.java b/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java
similarity index 87%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/impl/TypedJobItemExecutor.java
rename to elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java
index a99bb44..b2f0542 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/impl/TypedJobItemExecutor.java
+++ b/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.executor.item.impl;
+package org.apache.shardingsphere.elasticjob.executor.item.impl;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
-import org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor;
+import org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor;
import org.apache.shardingsphere.elasticjob.infra.spi.TypedSPI;
/**
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/executor/ElasticJobExecutorTest.java b/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/executor/ElasticJobExecutorTest.java
rename to elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java
index 23d5a3c..f3d27a4 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/executor/ElasticJobExecutorTest.java
+++ b/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java
@@ -15,23 +15,23 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.executor;
+package org.apache.shardingsphere.elasticjob.executor;
+import lombok.SneakyThrows;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.api.listener.ShardingContexts;
+import org.apache.shardingsphere.elasticjob.executor.fixture.executor.ClassedFooJobExecutor;
+import org.apache.shardingsphere.elasticjob.executor.fixture.job.FooJob;
import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException;
import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException;
-import org.apache.shardingsphere.elasticjob.lite.fixture.executor.ClassedFooJobExecutor;
-import org.apache.shardingsphere.elasticjob.lite.fixture.job.FooJob;
-import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State;
-import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
+import java.lang.reflect.Field;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -47,9 +47,6 @@ import static org.mockito.Mockito.when;
public final class ElasticJobExecutorTest {
@Mock
- private CoordinatorRegistryCenter regCenter;
-
- @Mock
private FooJob fooJob;
private JobConfiguration jobConfig;
@@ -65,9 +62,8 @@ public final class ElasticJobExecutorTest {
@Before
public void setUp() {
jobConfig = createJobConfiguration();
- elasticJobExecutor = new ElasticJobExecutor(regCenter, fooJob, jobConfig, Collections.emptyList(), null);
- ReflectionUtils.setFieldValue(elasticJobExecutor, "jobFacade", jobFacade);
- ReflectionUtils.setFieldValue(elasticJobExecutor, "jobItemExecutor", jobItemExecutor);
+ elasticJobExecutor = new ElasticJobExecutor(fooJob, jobConfig, jobFacade);
+ setJobItemExecutor();
}
private JobConfiguration createJobConfiguration() {
@@ -75,6 +71,13 @@ public final class ElasticJobExecutorTest {
.cron("0/1 * * * * ?").shardingItemParameters("0=A,1=B,2=C").jobParameter("param").failover(true).misfire(false).jobErrorHandlerType("THROW").description("desc").build();
}
+ @SneakyThrows
+ private void setJobItemExecutor() {
+ Field field = ElasticJobExecutor.class.getDeclaredField("jobItemExecutor");
+ field.setAccessible(true);
+ field.set(elasticJobExecutor, jobItemExecutor);
+ }
+
@Test(expected = JobSystemException.class)
public void assertExecuteWhenCheckMaxTimeDiffSecondsIntolerable() throws JobExecutionEnvironmentException {
doThrow(JobExecutionEnvironmentException.class).when(jobFacade).checkJobExecutionEnvironment();
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/executor/ClassedFooJobExecutor.java b/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java
similarity index 81%
copy from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/executor/ClassedFooJobExecutor.java
copy to elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java
index c9b939a..c5299c6 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/executor/ClassedFooJobExecutor.java
+++ b/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java
@@ -15,13 +15,13 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.fixture.executor;
+package org.apache.shardingsphere.elasticjob.executor.fixture.executor;
-import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.executor.JobFacade;
-import org.apache.shardingsphere.elasticjob.lite.executor.item.impl.ClassedJobItemExecutor;
-import org.apache.shardingsphere.elasticjob.lite.fixture.job.FooJob;
+import org.apache.shardingsphere.elasticjob.api.ShardingContext;
+import org.apache.shardingsphere.elasticjob.executor.JobFacade;
+import org.apache.shardingsphere.elasticjob.executor.fixture.job.FooJob;
+import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor;
public final class ClassedFooJobExecutor implements ClassedJobItemExecutor<FooJob> {
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/executor/TypedFooJobExecutor.java b/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java
similarity index 85%
rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/executor/TypedFooJobExecutor.java
rename to elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java
index 072b2f3..25c21d4 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/executor/TypedFooJobExecutor.java
+++ b/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java
@@ -15,13 +15,13 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.fixture.executor;
+package org.apache.shardingsphere.elasticjob.executor.fixture.executor;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
-import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.executor.JobFacade;
-import org.apache.shardingsphere.elasticjob.lite.executor.item.impl.TypedJobItemExecutor;
+import org.apache.shardingsphere.elasticjob.api.ShardingContext;
+import org.apache.shardingsphere.elasticjob.executor.JobFacade;
+import org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor;
public final class TypedFooJobExecutor implements TypedJobItemExecutor {
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/lite/simple/job/FooSimpleJob.java b/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java
similarity index 65%
copy from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/lite/simple/job/FooSimpleJob.java
copy to elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java
index af2e1bf..0cd62df 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/lite/simple/job/FooSimpleJob.java
+++ b/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java
@@ -15,18 +15,24 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.simple.job;
+package org.apache.shardingsphere.elasticjob.executor.fixture.job;
import lombok.Getter;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
-@Getter
-public final class FooSimpleJob implements SimpleJob {
+import java.util.Collection;
+import java.util.concurrent.CopyOnWriteArraySet;
+
+public final class DetailedFooJob implements FooJob {
+
+ private final Collection<Integer> completedJobItems = new CopyOnWriteArraySet<>();
+ @Getter
private volatile boolean completed;
@Override
- public void execute(final ShardingContext shardingContext) {
- completed = true;
+ public void foo(final ShardingContext shardingContext) {
+ completedJobItems.add(shardingContext.getShardingItem());
+ completed = completedJobItems.size() == shardingContext.getShardingTotalCount();
}
}
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/FailedJob.java b/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java
similarity index 93%
rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/FailedJob.java
rename to elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java
index 0063f80..6657d93 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/FailedJob.java
+++ b/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.fixture.job;
+package org.apache.shardingsphere.elasticjob.executor.fixture.job;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/simple/job/SimpleJob.java b/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java
similarity index 83%
copy from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/simple/job/SimpleJob.java
copy to elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java
index 690dc6b..edfaf11 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/simple/job/SimpleJob.java
+++ b/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java
@@ -15,20 +15,17 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.simple.job;
+package org.apache.shardingsphere.elasticjob.executor.fixture.job;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
-/**
- * Simple job.
- */
-public interface SimpleJob extends ElasticJob {
+public interface FooJob extends ElasticJob {
/**
- * Execute job.
+ * Do job.
*
* @param shardingContext sharding context
*/
- void execute(ShardingContext shardingContext);
+ void foo(ShardingContext shardingContext);
}
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutorFactoryTest.java b/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java
similarity index 80%
rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutorFactoryTest.java
rename to elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java
index 15a1598..c1607fd 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutorFactoryTest.java
+++ b/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java
@@ -15,14 +15,14 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.executor.item;
+package org.apache.shardingsphere.elasticjob.executor.item;
+import org.apache.shardingsphere.elasticjob.executor.fixture.executor.ClassedFooJobExecutor;
+import org.apache.shardingsphere.elasticjob.executor.fixture.executor.TypedFooJobExecutor;
+import org.apache.shardingsphere.elasticjob.executor.fixture.job.DetailedFooJob;
+import org.apache.shardingsphere.elasticjob.executor.fixture.job.FailedJob;
+import org.apache.shardingsphere.elasticjob.executor.fixture.job.FooJob;
import org.apache.shardingsphere.elasticjob.infra.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;
-import org.apache.shardingsphere.elasticjob.lite.fixture.job.FailedJob;
-import org.apache.shardingsphere.elasticjob.lite.fixture.job.FooJob;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.instanceOf;
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor b/elasticjob-executor/elasticjob-executor-kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor
similarity index 82%
copy from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor
copy to elasticjob-executor/elasticjob-executor-kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor
index f1aebfe..1fbaddb 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor
+++ b/elasticjob-executor/elasticjob-executor-kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor
@@ -15,4 +15,5 @@
# limitations under the License.
#
-org.apache.shardingsphere.elasticjob.lite.simple.executor.SimpleJobExecutor
+org.apache.shardingsphere.elasticjob.executor.fixture.executor.ClassedFooJobExecutor
+org.apache.shardingsphere.elasticjob.executor.fixture.executor.TypedFooJobExecutor
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/pom.xml b/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml
similarity index 90%
rename from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/pom.xml
rename to elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml
index f08d95a..39bd921 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/pom.xml
+++ b/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml
@@ -21,17 +21,17 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>elasticjob-lite-executor</artifactId>
+ <artifactId>elasticjob-executor-type</artifactId>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<version>3.0.0.M1-SNAPSHOT</version>
</parent>
- <artifactId>elasticjob-lite-dataflow-executor</artifactId>
+ <artifactId>elasticjob-dataflow-executor</artifactId>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-core</artifactId>
+ <artifactId>elasticjob-executor-kernel</artifactId>
<version>${project.parent.version}</version>
</dependency>
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/dataflow/executor/DataflowJobExecutor.java b/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java
similarity index 89%
rename from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/dataflow/executor/DataflowJobExecutor.java
rename to elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java
index 65ca404..0de4700 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/dataflow/executor/DataflowJobExecutor.java
+++ b/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java
@@ -15,14 +15,14 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.dataflow.executor;
+package org.apache.shardingsphere.elasticjob.dataflow.executor;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
-import org.apache.shardingsphere.elasticjob.lite.dataflow.job.DataflowJob;
-import org.apache.shardingsphere.elasticjob.lite.dataflow.props.DataflowJobProperties;
-import org.apache.shardingsphere.elasticjob.lite.executor.JobFacade;
-import org.apache.shardingsphere.elasticjob.lite.executor.item.impl.ClassedJobItemExecutor;
+import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob;
+import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties;
+import org.apache.shardingsphere.elasticjob.executor.JobFacade;
+import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor;
import java.util.List;
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/dataflow/job/DataflowJob.java b/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java
similarity index 95%
rename from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/dataflow/job/DataflowJob.java
rename to elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java
index 205613c..486fdbf 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/dataflow/job/DataflowJob.java
+++ b/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.dataflow.job;
+package org.apache.shardingsphere.elasticjob.dataflow.job;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/dataflow/props/DataflowJobProperties.java b/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/dataflow/props/DataflowJobProperties.java
rename to elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java
index 3580212..4aed546 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/dataflow/props/DataflowJobProperties.java
+++ b/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.dataflow.props;
+package org.apache.shardingsphere.elasticjob.dataflow.props;
/**
* Dataflow job properties.
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor b/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor
similarity index 91%
copy from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor
copy to elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor
index f1aebfe..1c7177c 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor
+++ b/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor
@@ -15,4 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.elasticjob.lite.simple.executor.SimpleJobExecutor
+org.apache.shardingsphere.elasticjob.dataflow.executor.DataflowJobExecutor
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/lite/dataflow/job/BatchDataflowJob.java b/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/job/BatchDataflowJob.java
similarity index 96%
rename from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/lite/dataflow/job/BatchDataflowJob.java
rename to elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/job/BatchDataflowJob.java
index d3ffeef..be6ca88 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/lite/dataflow/job/BatchDataflowJob.java
+++ b/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/job/BatchDataflowJob.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.dataflow.job;
+package org.apache.shardingsphere.elasticjob.dataflow.job;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/lite/dataflow/job/StreamingDataflowJob.java b/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/job/StreamingDataflowJob.java
similarity index 96%
rename from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/lite/dataflow/job/StreamingDataflowJob.java
rename to elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/job/StreamingDataflowJob.java
index 20a65e9..16efc82 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/lite/dataflow/job/StreamingDataflowJob.java
+++ b/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/job/StreamingDataflowJob.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.dataflow.job;
+package org.apache.shardingsphere.elasticjob.dataflow.job;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/pom.xml b/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml
similarity index 84%
rename from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/pom.xml
rename to elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml
index a51d220..15281fb 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/pom.xml
+++ b/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml
@@ -22,20 +22,25 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-executor</artifactId>
+ <artifactId>elasticjob-executor-type</artifactId>
<version>3.0.0.M1-SNAPSHOT</version>
</parent>
- <artifactId>elasticjob-lite-script-executor</artifactId>
+ <artifactId>elasticjob-script-executor</artifactId>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-core</artifactId>
+ <artifactId>elasticjob-executor-kernel</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-exec</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
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-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java
similarity index 89%
rename from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/script/executor/ScriptJobExecutor.java
rename to elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java
index ff5c447..7817907 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-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.script.executor;
+package org.apache.shardingsphere.elasticjob.script.executor;
import com.google.common.base.Strings;
import org.apache.commons.exec.CommandLine;
@@ -25,9 +25,9 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException;
import org.apache.shardingsphere.elasticjob.infra.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.executor.JobFacade;
+import org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor;
+import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties;
import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory;
import java.io.IOException;
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/script/props/ScriptJobProperties.java b/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/script/props/ScriptJobProperties.java
rename to elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java
index c6eff3a..ff3137f 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/script/props/ScriptJobProperties.java
+++ b/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.script.props;
+package org.apache.shardingsphere.elasticjob.script.props;
/**
* Script job properties.
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor b/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor
similarity index 90%
rename from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor
rename to elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor
index 4aee7bb..9226a56 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-dataflow-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor
+++ b/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor
@@ -15,4 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.elasticjob.lite.dataflow.executor.DataflowJobExecutor
+org.apache.shardingsphere.elasticjob.script.executor.ScriptJobExecutor
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/pom.xml b/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml
similarity index 90%
rename from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/pom.xml
rename to elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml
index 3297ad8..b36efff 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/pom.xml
+++ b/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml
@@ -22,16 +22,16 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-executor</artifactId>
+ <artifactId>elasticjob-executor-type</artifactId>
<version>3.0.0.M1-SNAPSHOT</version>
</parent>
- <artifactId>elasticjob-lite-simple-executor</artifactId>
+ <artifactId>elasticjob-simple-executor</artifactId>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-core</artifactId>
+ <artifactId>elasticjob-executor-kernel</artifactId>
<version>${project.parent.version}</version>
</dependency>
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/simple/executor/SimpleJobExecutor.java b/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java
similarity index 82%
rename from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/simple/executor/SimpleJobExecutor.java
rename to elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java
index 9aa9c04..d6f6c8e 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/simple/executor/SimpleJobExecutor.java
+++ b/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java
@@ -15,13 +15,13 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.simple.executor;
+package org.apache.shardingsphere.elasticjob.simple.executor;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.simple.job.SimpleJob;
-import org.apache.shardingsphere.elasticjob.lite.executor.JobFacade;
-import org.apache.shardingsphere.elasticjob.lite.executor.item.impl.ClassedJobItemExecutor;
+import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;
+import org.apache.shardingsphere.elasticjob.executor.JobFacade;
+import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor;
/**
* Simple job executor.
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/simple/job/SimpleJob.java b/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/simple/job/SimpleJob.java
rename to elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java
index 690dc6b..a414cd9 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/simple/job/SimpleJob.java
+++ b/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.simple.job;
+package org.apache.shardingsphere.elasticjob.simple.job;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor b/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor
similarity index 91%
rename from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor
rename to elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor
index f1aebfe..49e3e65 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor
+++ b/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor
@@ -15,4 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.elasticjob.lite.simple.executor.SimpleJobExecutor
+org.apache.shardingsphere.elasticjob.simple.executor.SimpleJobExecutor
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/lite/simple/job/FooSimpleJob.java b/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/lite/simple/job/FooSimpleJob.java
rename to elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java
index af2e1bf..72e24a9 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/lite/simple/job/FooSimpleJob.java
+++ b/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.simple.job;
+package org.apache.shardingsphere.elasticjob.simple.job;
import lombok.Getter;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
diff --git a/elasticjob-lite/elasticjob-lite-executor/pom.xml b/elasticjob-executor/elasticjob-executor-type/pom.xml
similarity index 83%
copy from elasticjob-lite/elasticjob-lite-executor/pom.xml
copy to elasticjob-executor/elasticjob-executor-type/pom.xml
index aa70add..71430c8 100644
--- a/elasticjob-lite/elasticjob-lite-executor/pom.xml
+++ b/elasticjob-executor/elasticjob-executor-type/pom.xml
@@ -22,16 +22,16 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite</artifactId>
+ <artifactId>elasticjob-executor</artifactId>
<version>3.0.0.M1-SNAPSHOT</version>
</parent>
- <artifactId>elasticjob-lite-executor</artifactId>
+ <artifactId>elasticjob-executor-type</artifactId>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
<modules>
- <module>elasticjob-lite-simple-executor</module>
- <module>elasticjob-lite-dataflow-executor</module>
- <module>elasticjob-lite-script-executor</module>
+ <module>elasticjob-simple-executor</module>
+ <module>elasticjob-dataflow-executor</module>
+ <module>elasticjob-script-executor</module>
</modules>
</project>
diff --git a/elasticjob-lite/elasticjob-lite-executor/pom.xml b/elasticjob-executor/pom.xml
similarity index 83%
rename from elasticjob-lite/elasticjob-lite-executor/pom.xml
rename to elasticjob-executor/pom.xml
index aa70add..9cd92d9 100644
--- a/elasticjob-lite/elasticjob-lite-executor/pom.xml
+++ b/elasticjob-executor/pom.xml
@@ -22,16 +22,15 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite</artifactId>
+ <artifactId>elasticjob</artifactId>
<version>3.0.0.M1-SNAPSHOT</version>
</parent>
- <artifactId>elasticjob-lite-executor</artifactId>
+ <artifactId>elasticjob-executor</artifactId>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
<modules>
- <module>elasticjob-lite-simple-executor</module>
- <module>elasticjob-lite-dataflow-executor</module>
- <module>elasticjob-lite-script-executor</module>
+ <module>elasticjob-executor-kernel</module>
+ <module>elasticjob-executor-type</module>
</modules>
</project>
diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-lite/elasticjob-lite-core/pom.xml
index a8e88d2..f821140 100644
--- a/elasticjob-lite/elasticjob-lite-core/pom.xml
+++ b/elasticjob-lite/elasticjob-lite-core/pom.xml
@@ -43,6 +43,11 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
+ <artifactId>elasticjob-executor-kernel</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-tracing-rdb</artifactId>
<version>${project.parent.version}</version>
</dependency>
@@ -63,11 +68,6 @@
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-exec</artifactId>
- <version>${commons-exec.version}</version>
- </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJob.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJob.java
index c3d28e0..913b784 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJob.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJob.java
@@ -19,9 +19,9 @@ package org.apache.shardingsphere.elasticjob.lite.internal.schedule;
import lombok.Setter;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
-import org.apache.shardingsphere.elasticjob.api.listener.ElasticJobListener;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.executor.ElasticJobExecutor;
+import org.apache.shardingsphere.elasticjob.api.listener.ElasticJobListener;
+import org.apache.shardingsphere.elasticjob.executor.ElasticJobExecutor;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
import org.quartz.Job;
@@ -53,8 +53,7 @@ public final class LiteJob implements Job {
}
private ElasticJobExecutor createExecutor() {
- return null == elasticJob
- ? new ElasticJobExecutor(regCenter, elasticJobType, jobConfig, elasticJobListeners, tracingConfig)
- : new ElasticJobExecutor(regCenter, elasticJob, jobConfig, elasticJobListeners, tracingConfig);
+ LiteJobFacade jobFacade = new LiteJobFacade(regCenter, jobConfig.getJobName(), elasticJobListeners, tracingConfig);
+ return null == elasticJob ? new ElasticJobExecutor(elasticJobType, jobConfig, jobFacade) : new ElasticJobExecutor(elasticJob, jobConfig, jobFacade);
}
}
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 c3208ec..23067b5 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,9 +22,9 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.api.listener.ElasticJobListener;
import org.apache.shardingsphere.elasticjob.api.listener.ShardingContexts;
+import org.apache.shardingsphere.elasticjob.executor.JobFacade;
import org.apache.shardingsphere.elasticjob.infra.context.TaskContext;
import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException;
-import org.apache.shardingsphere.elasticjob.lite.executor.JobFacade;
import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService;
import org.apache.shardingsphere.elasticjob.lite.internal.failover.FailoverService;
import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ExecutionContextService;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/executor/ClassedFooJobExecutor.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/executor/ClassedFooJobExecutor.java
index c9b939a..e148bf9 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/executor/ClassedFooJobExecutor.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/executor/ClassedFooJobExecutor.java
@@ -17,10 +17,10 @@
package org.apache.shardingsphere.elasticjob.lite.fixture.executor;
-import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.executor.JobFacade;
-import org.apache.shardingsphere.elasticjob.lite.executor.item.impl.ClassedJobItemExecutor;
+import org.apache.shardingsphere.elasticjob.api.ShardingContext;
+import org.apache.shardingsphere.elasticjob.executor.JobFacade;
+import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor;
import org.apache.shardingsphere.elasticjob.lite.fixture.job.FooJob;
public final class ClassedFooJobExecutor implements ClassedJobItemExecutor<FooJob> {
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor b/elasticjob-lite/elasticjob-lite-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor
similarity index 91%
rename from elasticjob-lite/elasticjob-lite-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor
rename to elasticjob-lite/elasticjob-lite-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor
index cde153e..c9b362b 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor
@@ -16,4 +16,3 @@
#
org.apache.shardingsphere.elasticjob.lite.fixture.executor.ClassedFooJobExecutor
-org.apache.shardingsphere.elasticjob.lite.fixture.executor.TypedFooJobExecutor
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor b/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor
deleted file mode 100644
index 30aa4c8..0000000
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor
+++ /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.
-#
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-org.apache.shardingsphere.elasticjob.lite.script.executor.ScriptJobExecutor
diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml
index 78808d2..0d667ea 100644
--- a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml
+++ b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml
@@ -34,17 +34,17 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-simple-executor</artifactId>
+ <artifactId>elasticjob-simple-executor</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-dataflow-executor</artifactId>
+ <artifactId>elasticjob-dataflow-executor</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-script-executor</artifactId>
+ <artifactId>elasticjob-script-executor</artifactId>
<version>${project.parent.version}</version>
</dependency>
diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/fixture/TestDataflowJob.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/fixture/TestDataflowJob.java
index 17e1ecd..5864423 100644
--- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/fixture/TestDataflowJob.java
+++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/fixture/TestDataflowJob.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.lite.lifecycle.fixture;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
-import org.apache.shardingsphere.elasticjob.lite.dataflow.job.DataflowJob;
+import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob;
import java.util.List;
diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/fixture/TestSimpleJob.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/fixture/TestSimpleJob.java
index 00e663d..7dbc4d4 100644
--- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/fixture/TestSimpleJob.java
+++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/fixture/TestSimpleJob.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.lite.lifecycle.fixture;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
-import org.apache.shardingsphere.elasticjob.lite.simple.job.SimpleJob;
+import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;
public class TestSimpleJob implements SimpleJob {
diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java
index a5b47d8..65af3ac 100644
--- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java
+++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java
@@ -17,12 +17,12 @@
package org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.settings;
-import org.apache.shardingsphere.elasticjob.lite.dataflow.props.DataflowJobProperties;
+import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties;
import org.apache.shardingsphere.elasticjob.lite.internal.config.yaml.YamlJobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobConfigurationAPI;
import org.apache.shardingsphere.elasticjob.lite.lifecycle.fixture.LifecycleYamlConstants;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.script.props.ScriptJobProperties;
+import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/elasticjob-lite/elasticjob-lite-spring/pom.xml b/elasticjob-lite/elasticjob-lite-spring/pom.xml
index cc5c65e..270a2fb 100644
--- a/elasticjob-lite/elasticjob-lite-spring/pom.xml
+++ b/elasticjob-lite/elasticjob-lite-spring/pom.xml
@@ -33,17 +33,17 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-simple-executor</artifactId>
+ <artifactId>elasticjob-simple-executor</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-dataflow-executor</artifactId>
+ <artifactId>elasticjob-dataflow-executor</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-script-executor</artifactId>
+ <artifactId>elasticjob-script-executor</artifactId>
<version>${project.parent.version}</version>
</dependency>
diff --git a/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/DataflowElasticJob.java b/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/DataflowElasticJob.java
index fa3b8b8..1da1980 100644
--- a/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/DataflowElasticJob.java
+++ b/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/DataflowElasticJob.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.elasticjob.lite.spring.fixture.job;
import lombok.Getter;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
-import org.apache.shardingsphere.elasticjob.lite.dataflow.job.DataflowJob;
+import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob;
import java.util.Collections;
import java.util.List;
diff --git a/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/FooSimpleElasticJob.java b/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/FooSimpleElasticJob.java
index ac81852..c6a7b42 100644
--- a/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/FooSimpleElasticJob.java
+++ b/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/FooSimpleElasticJob.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.elasticjob.lite.spring.fixture.job;
import lombok.Getter;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
-import org.apache.shardingsphere.elasticjob.lite.simple.job.SimpleJob;
+import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;
public class FooSimpleElasticJob implements SimpleJob {
diff --git a/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/ref/RefFooDataflowElasticJob.java b/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/ref/RefFooDataflowElasticJob.java
index 0b3b404..cb25bb1 100644
--- a/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/ref/RefFooDataflowElasticJob.java
+++ b/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/ref/RefFooDataflowElasticJob.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.elasticjob.lite.spring.fixture.job.ref;
import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
-import org.apache.shardingsphere.elasticjob.lite.dataflow.job.DataflowJob;
+import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob;
import org.apache.shardingsphere.elasticjob.lite.spring.fixture.service.FooService;
import java.util.Collections;
diff --git a/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/ref/RefFooSimpleElasticJob.java b/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/ref/RefFooSimpleElasticJob.java
index c1186d8..8a58d6e 100644
--- a/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/ref/RefFooSimpleElasticJob.java
+++ b/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/fixture/job/ref/RefFooSimpleElasticJob.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.elasticjob.lite.spring.fixture.job.ref;
import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
-import org.apache.shardingsphere.elasticjob.lite.simple.job.SimpleJob;
+import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;
import org.apache.shardingsphere.elasticjob.lite.spring.fixture.service.FooService;
public class RefFooSimpleElasticJob implements SimpleJob {
diff --git a/elasticjob-lite/pom.xml b/elasticjob-lite/pom.xml
index a297e49..fc5a47d 100644
--- a/elasticjob-lite/pom.xml
+++ b/elasticjob-lite/pom.xml
@@ -31,7 +31,6 @@
<modules>
<module>elasticjob-lite-core</module>
- <module>elasticjob-lite-executor</module>
<module>elasticjob-lite-spring</module>
<module>elasticjob-lite-lifecycle</module>
<module>elasticjob-lite-console</module>
diff --git a/examples/elasticjob-example-jobs/pom.xml b/examples/elasticjob-example-jobs/pom.xml
index 76506cb..0ab70e1 100644
--- a/examples/elasticjob-example-jobs/pom.xml
+++ b/examples/elasticjob-example-jobs/pom.xml
@@ -33,16 +33,16 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-simple-executor</artifactId>
+ <artifactId>elasticjob-simple-executor</artifactId>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-dataflow-executor</artifactId>
+ <artifactId>elasticjob-dataflow-executor</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-script-executor</artifactId>
+ <artifactId>elasticjob-script-executor</artifactId>
<version>${project.parent.version}</version>
</dependency>
diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/JavaDataflowJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/JavaDataflowJob.java
index 079e29b..0f06871 100644
--- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/JavaDataflowJob.java
+++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/JavaDataflowJob.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.lite.example.job.dataflow;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
-import org.apache.shardingsphere.elasticjob.lite.dataflow.job.DataflowJob;
+import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob;
import org.apache.shardingsphere.elasticjob.lite.example.fixture.entity.Foo;
import org.apache.shardingsphere.elasticjob.lite.example.fixture.repository.FooRepository;
import org.apache.shardingsphere.elasticjob.lite.example.fixture.repository.FooRepositoryFactory;
diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/SpringDataflowJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/SpringDataflowJob.java
index 23122aa..322d146 100644
--- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/SpringDataflowJob.java
+++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/SpringDataflowJob.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.lite.example.job.dataflow;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
-import org.apache.shardingsphere.elasticjob.lite.dataflow.job.DataflowJob;
+import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob;
import org.apache.shardingsphere.elasticjob.lite.example.fixture.entity.Foo;
import org.apache.shardingsphere.elasticjob.lite.example.fixture.repository.FooRepository;
diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaSimpleJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaSimpleJob.java
index 27ecf55..9443ddc 100644
--- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaSimpleJob.java
+++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaSimpleJob.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.lite.example.job.simple;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
-import org.apache.shardingsphere.elasticjob.lite.simple.job.SimpleJob;
+import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;
import org.apache.shardingsphere.elasticjob.lite.example.fixture.entity.Foo;
import org.apache.shardingsphere.elasticjob.lite.example.fixture.repository.FooRepository;
import org.apache.shardingsphere.elasticjob.lite.example.fixture.repository.FooRepositoryFactory;
diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/SpringSimpleJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/SpringSimpleJob.java
index 6fc795f..c7fbc81 100644
--- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/SpringSimpleJob.java
+++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/SpringSimpleJob.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.lite.example.job.simple;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
-import org.apache.shardingsphere.elasticjob.lite.simple.job.SimpleJob;
+import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;
import org.apache.shardingsphere.elasticjob.lite.example.fixture.entity.Foo;
import org.apache.shardingsphere.elasticjob.lite.example.fixture.repository.FooRepository;
diff --git a/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/JavaMain.java b/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/JavaMain.java
index 2bd2217..0019d50 100644
--- a/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/JavaMain.java
+++ b/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/JavaMain.java
@@ -20,13 +20,13 @@ package org.apache.shardingsphere.elasticjob.lite.example;
import org.apache.commons.dbcp.BasicDataSource;
import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.dataflow.props.DataflowJobProperties;
+import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties;
import org.apache.shardingsphere.elasticjob.lite.example.job.dataflow.JavaDataflowJob;
import org.apache.shardingsphere.elasticjob.lite.example.job.simple.JavaSimpleJob;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration;
import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.script.props.ScriptJobProperties;
+import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties;
import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
import javax.sql.DataSource;
diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/DataflowJobConfig.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/DataflowJobConfig.java
index c2c38e7..ab95532 100644
--- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/DataflowJobConfig.java
+++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/DataflowJobConfig.java
@@ -19,8 +19,8 @@ package org.apache.shardingsphere.elasticjob.lite.example.config;
import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.dataflow.job.DataflowJob;
-import org.apache.shardingsphere.elasticjob.lite.dataflow.props.DataflowJobProperties;
+import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob;
+import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties;
import org.apache.shardingsphere.elasticjob.lite.example.job.dataflow.SpringDataflowJob;
import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter;
import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/SimpleJobConfig.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/SimpleJobConfig.java
index 9c1674f..01d40c5 100644
--- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/SimpleJobConfig.java
+++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/SimpleJobConfig.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.lite.example.config;
import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap;
-import org.apache.shardingsphere.elasticjob.lite.simple.job.SimpleJob;
+import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.example.job.simple.SpringSimpleJob;
import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter;
diff --git a/examples/pom.xml b/examples/pom.xml
index b807d0e..1ea4e3b 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -57,7 +57,7 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-simple-executor</artifactId>
+ <artifactId>elasticjob-simple-executor</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
diff --git a/pom.xml b/pom.xml
index 449dae1..2d2324e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,6 +33,7 @@
<modules>
<module>elasticjob-api</module>
<module>elasticjob-infra</module>
+ <module>elasticjob-executor</module>
<module>elasticjob-lite</module>
<module>elasticjob-cloud</module>
</modules>