Skip to content

Commit

Permalink
Add eslaticjob bootstrap module
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Oct 30, 2023
1 parent 621cf95 commit 910033b
Show file tree
Hide file tree
Showing 38 changed files with 143 additions and 46 deletions.
48 changes: 48 additions & 0 deletions bootstrap/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob</artifactId>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>elasticjob-bootstrap</artifactId>
<name>${project.artifactId}</name>

<dependencies>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-kernel</artifactId>
<version>${project.parent.version}</version>
</dependency>

<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-test-util</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.elasticjob.kernel.api.bootstrap;
package org.apache.shardingsphere.elasticjob.bootstrap;

/**
* Job bootstrap.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
* limitations under the License.
*/

package org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl;
package org.apache.shardingsphere.elasticjob.bootstrap.impl;

import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.JobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.JobBootstrap;
import org.apache.shardingsphere.elasticjob.kernel.internal.annotation.JobAnnotationBuilder;
import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService;
import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
* limitations under the License.
*/

package org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl;
package org.apache.shardingsphere.elasticjob.bootstrap.impl;

import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.JobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.JobBootstrap;
import org.apache.shardingsphere.elasticjob.kernel.internal.annotation.JobAnnotationBuilder;
import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl;
package org.apache.shardingsphere.elasticjob.bootstrap.impl;

import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler;
Expand Down
48 changes: 48 additions & 0 deletions bootstrap/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<configuration>
<property name="log.context.name" value="elasticjob-test" />
<property name="log.charset" value="UTF-8" />
<property name="log.pattern" value="[%-5level] %date --%thread-- [%logger] %msg %n" />

<contextName>${log.context.name}</contextName>

<statusListener class="ch.qos.logback.core.status.NopStatusListener" />

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
<encoder charset="${log.charset}">
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<appender name="LogJobErrorHandlerTestAppender" class="ch.qos.logback.core.read.ListAppender" />

<root>
<appender-ref ref="STDOUT" />
</root>

<logger name="org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService" level="OFF" />
<logger name="org.apache.shardingsphere.elasticjob.infra.handler.error.impl.LogJobErrorHandler" level="OFF" />
<logger name="org.apache.curator.framework.listen.MappingListenerManager" level="OFF" />
<logger name="org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general.LogJobErrorHandler" level="error" additivity="false">
<appender-ref ref="LogJobErrorHandlerTestAppender" />
</logger>
</configuration>
2 changes: 1 addition & 1 deletion distribution/bin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-kernel</artifactId>
<artifactId>elasticjob-bootstrap</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion docs/content/quick-start/_index.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ chapter = true
```xml
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-kernel</artifactId>
<artifactId>elasticjob-bootstrap</artifactId>
<version>${latest.release.version}</version>
</dependency>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/content/quick-start/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ chapter = true
```xml
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-kernel</artifactId>
<artifactId>elasticjob-bootstrap</artifactId>
<version>${latest.release.version}</version>
</dependency>
```
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/tracing/api/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
-->

<configuration>
<property name="log.context.name" value="elasticjob-kernel-test" />
<property name="log.context.name" value="elasticjob-test" />
<property name="log.charset" value="UTF-8" />
<property name="log.pattern" value="[%-5level] %date --%thread-- [%logger] %msg %n" />

Expand Down
2 changes: 1 addition & 1 deletion ecosystem/tracing/rdb/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
-->

<configuration>
<property name="log.context.name" value="elasticjob-kernel-test" />
<property name="log.context.name" value="elasticjob-test" />
<property name="log.charset" value="UTF-8" />
<property name="log.pattern" value="[%-5level] %date --%thread-- [%logger] %msg %n" />

Expand Down
2 changes: 1 addition & 1 deletion examples/elasticjob-example-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-kernel</artifactId>
<artifactId>elasticjob-bootstrap</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import org.apache.shardingsphere.elasticjob.error.handler.wechat.WechatPropertiesConstants;
import org.apache.shardingsphere.elasticjob.example.job.dataflow.JavaDataflowJob;
import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties;
import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap;
import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap;
import org.apache.shardingsphere.elasticjob.example.job.simple.JavaOccurErrorJob;
import org.apache.shardingsphere.elasticjob.example.job.simple.JavaSimpleJob;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
Expand Down
2 changes: 1 addition & 1 deletion examples/elasticjob-example-jobs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-kernel</artifactId>
<artifactId>elasticjob-bootstrap</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.shardingsphere.elasticjob.example.controller;

import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
Expand Down
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-kernel</artifactId>
<artifactId>elasticjob-bootstrap</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion infra/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
-->

<configuration>
<property name="log.context.name" value="elasticjob-kernel-test" />
<property name="log.context.name" value="elasticjob-test" />
<property name="log.charset" value="UTF-8" />
<property name="log.pattern" value="[%-5level] %date --%thread-- [%logger] %msg %n" />

Expand Down
2 changes: 1 addition & 1 deletion kernel/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
-->

<configuration>
<property name="log.context.name" value="elasticjob-kernel-test" />
<property name="log.context.name" value="elasticjob-test" />
<property name="log.charset" value="UTF-8" />
<property name="log.pattern" value="[%-5level] %date --%thread-- [%logger] %msg %n" />

Expand Down
2 changes: 1 addition & 1 deletion lifecycle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-kernel</artifactId>
<artifactId>elasticjob-bootstrap</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<modules>
<module>api</module>
<module>registry-center</module>
<module>bootstrap</module>
<module>infra</module>
<module>kernel</module>
<module>lifecycle</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
-->

<configuration>
<property name="log.context.name" value="elasticjob-kernel-test" />
<property name="log.context.name" value="elasticjob-test" />
<property name="log.charset" value="UTF-8" />
<property name="log.pattern" value="[%-5level] %date --%thread-- [%logger] %msg %n" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap;
import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap;
import org.apache.shardingsphere.elasticjob.spring.boot.tracing.TracingProperties;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.shardingsphere.elasticjob.spring.boot.job;

import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap;
import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl.AnnotationCustomJob;
import org.apache.shardingsphere.elasticjob.spring.core.scanner.ElasticJobScan;
import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

import org.apache.shardingsphere.elasticjob.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration;
import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.JobBootstrap;
import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap;
import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.JobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap;
import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler;
import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter;
import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl.CustomTestJob;
Expand Down
2 changes: 1 addition & 1 deletion spring/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-kernel</artifactId>
<artifactId>elasticjob-bootstrap</artifactId>
<version>${project.parent.version}</version>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import org.apache.commons.lang3.StringUtils;
import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration;
import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.springframework.beans.factory.config.BeanDefinitionHolder;
import org.springframework.beans.factory.config.RuntimeBeanReference;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import com.google.common.base.Strings;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap;
import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap;
import org.apache.shardingsphere.elasticjob.spring.namespace.job.tag.JobBeanDefinitionTag;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.spring.namespace.job;

import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap;
import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.DataflowElasticJob;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.shardingsphere.elasticjob.spring.namespace.job;

import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap;
import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.shardingsphere.elasticjob.spring.namespace.job;

import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap;
import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap;
import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer;
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-kernel</artifactId>
<artifactId>elasticjob-bootstrap</artifactId>
<version>${project.parent.version}</version>
</dependency>

Expand Down
Loading

0 comments on commit 910033b

Please sign in to comment.