Repository: apache/shardingsphere-elasticjob Branch: master Commit: 674ff4f63da6 Files: 995 Total size: 2.7 MB Directory structure: gitextract_t3lvgrxz/ ├── .asf.yaml ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── bug-report.md │ │ ├── feature-request.md │ │ └── question.md │ ├── PULL_REQUEST_TEMPLATE │ └── workflows/ │ ├── graalvm.yml │ ├── maven.yml │ └── required-check.yml ├── .gitignore ├── .idea/ │ └── vcs.xml ├── .mvn/ │ ├── jvm.config │ └── wrapper/ │ └── maven-wrapper.properties ├── LICENSE ├── NOTICE ├── README.md ├── README_ZH.md ├── RELEASE-NOTES.md ├── api/ │ ├── pom.xml │ └── src/ │ ├── main/ │ │ └── java/ │ │ └── org/ │ │ └── apache/ │ │ └── shardingsphere/ │ │ └── elasticjob/ │ │ ├── annotation/ │ │ │ ├── ElasticJobConfiguration.java │ │ │ └── ElasticJobProp.java │ │ ├── api/ │ │ │ ├── ElasticJob.java │ │ │ ├── JobConfiguration.java │ │ │ ├── JobExtraConfiguration.java │ │ │ └── JobExtraConfigurationFactory.java │ │ └── spi/ │ │ ├── executor/ │ │ │ ├── ExecutionType.java │ │ │ ├── error/ │ │ │ │ └── handler/ │ │ │ │ ├── JobErrorHandler.java │ │ │ │ └── JobErrorHandlerPropertiesValidator.java │ │ │ └── item/ │ │ │ ├── JobItemExecutor.java │ │ │ ├── param/ │ │ │ │ ├── JobRuntimeService.java │ │ │ │ └── ShardingContext.java │ │ │ └── type/ │ │ │ ├── ClassedJobItemExecutor.java │ │ │ └── TypedJobItemExecutor.java │ │ ├── listener/ │ │ │ ├── ElasticJobListener.java │ │ │ └── param/ │ │ │ └── ShardingContexts.java │ │ ├── tracing/ │ │ │ ├── event/ │ │ │ │ ├── JobEvent.java │ │ │ │ ├── JobExecutionEvent.java │ │ │ │ └── JobStatusTraceEvent.java │ │ │ ├── exception/ │ │ │ │ └── TracingConfigurationException.java │ │ │ ├── listener/ │ │ │ │ ├── TracingListener.java │ │ │ │ └── TracingListenerFactory.java │ │ │ └── storage/ │ │ │ ├── TracingStorageConfiguration.java │ │ │ └── TracingStorageConfigurationConverter.java │ │ └── yaml/ │ │ ├── YamlConfiguration.java │ │ └── YamlConfigurationConverter.java │ └── test/ │ └── java/ │ └── org/ │ └── apache/ │ └── shardingsphere/ │ └── elasticjob/ │ ├── annotation/ │ │ ├── ElasticJobConfigurationTest.java │ │ ├── SimpleTracingConfigurationFactory.java │ │ └── job/ │ │ ├── CustomJob.java │ │ └── impl/ │ │ └── SimpleTestJob.java │ ├── api/ │ │ └── JobConfigurationTest.java │ └── spi/ │ └── listener/ │ └── param/ │ └── ShardingContextsTest.java ├── bootstrap/ │ ├── pom.xml │ └── src/ │ ├── main/ │ │ └── java/ │ │ └── org/ │ │ └── apache/ │ │ └── shardingsphere/ │ │ └── elasticjob/ │ │ └── bootstrap/ │ │ ├── JobBootstrap.java │ │ └── type/ │ │ ├── OneOffJobBootstrap.java │ │ └── ScheduleJobBootstrap.java │ └── test/ │ ├── java/ │ │ └── org/ │ │ └── apache/ │ │ └── shardingsphere/ │ │ └── elasticjob/ │ │ └── bootstrap/ │ │ └── type/ │ │ ├── OneOffJobBootstrapTest.java │ │ └── ScheduleJobBootstrapTest.java │ └── resources/ │ └── logback-test.xml ├── distribution/ │ ├── bin/ │ │ ├── pom.xml │ │ └── src/ │ │ └── main/ │ │ ├── assembly/ │ │ │ └── elasticjob-binary-distribution.xml │ │ └── release-docs/ │ │ └── README.txt │ ├── pom.xml │ └── src/ │ ├── pom.xml │ └── src/ │ └── main/ │ └── assembly/ │ └── source-distribution.xml ├── docs/ │ ├── README.md │ ├── archetypes/ │ │ └── default.md │ ├── build.sh │ ├── config.toml │ ├── content/ │ │ ├── blog/ │ │ │ ├── _index.cn.md │ │ │ └── _index.en.md │ │ ├── dev-manual/ │ │ │ ├── _index.cn.md │ │ │ ├── _index.en.md │ │ │ ├── error-handler.cn.md │ │ │ ├── error-handler.en.md │ │ │ ├── job-class-provider.cn.md │ │ │ ├── job-class-provider.en.md │ │ │ ├── roadmap.cn.md │ │ │ ├── roadmap.en.md │ │ │ ├── sharding.cn.md │ │ │ ├── sharding.en.md │ │ │ ├── thread-pool.cn.md │ │ │ └── thread-pool.en.md │ │ ├── downloads/ │ │ │ ├── _index.cn.md │ │ │ └── _index.en.md │ │ ├── faq/ │ │ │ ├── _index.cn.md │ │ │ └── _index.en.md │ │ ├── features/ │ │ │ ├── _index.cn.md │ │ │ ├── _index.en.md │ │ │ ├── elastic.cn.md │ │ │ ├── elastic.en.md │ │ │ ├── failover.cn.md │ │ │ ├── failover.en.md │ │ │ ├── job-type.cn.md │ │ │ ├── job-type.en.md │ │ │ ├── misfire.cn.md │ │ │ ├── misfire.en.md │ │ │ ├── schedule-model.cn.md │ │ │ └── schedule-model.en.md │ │ ├── overview/ │ │ │ ├── _index.cn.md │ │ │ └── _index.en.md │ │ ├── powered-by/ │ │ │ ├── _index.cn.md │ │ │ └── _index.en.md │ │ ├── quick-start/ │ │ │ ├── _index.cn.md │ │ │ └── _index.en.md │ │ └── user-manual/ │ │ ├── _index.cn.md │ │ ├── _index.en.md │ │ ├── configuration/ │ │ │ ├── _index.cn.md │ │ │ ├── _index.en.md │ │ │ ├── built-in-strategy/ │ │ │ │ ├── _index.cn.md │ │ │ │ ├── _index.en.md │ │ │ │ ├── error-handler.cn.md │ │ │ │ ├── error-handler.en.md │ │ │ │ ├── sharding.cn.md │ │ │ │ ├── sharding.en.md │ │ │ │ ├── thread-pool.cn.md │ │ │ │ └── thread-pool.en.md │ │ │ ├── external-integration/ │ │ │ │ ├── _index.cn.md │ │ │ │ ├── _index.en.md │ │ │ │ ├── sasl.cn.md │ │ │ │ └── sasl.en.md │ │ │ ├── graalvm-native-image.cn.md │ │ │ ├── graalvm-native-image.en.md │ │ │ ├── java-api.cn.md │ │ │ ├── java-api.en.md │ │ │ ├── props.cn.md │ │ │ ├── props.en.md │ │ │ ├── spring-boot-starter.cn.md │ │ │ ├── spring-boot-starter.en.md │ │ │ ├── spring-namespace.cn.md │ │ │ └── spring-namespace.en.md │ │ ├── operation/ │ │ │ ├── _index.cn.md │ │ │ ├── _index.en.md │ │ │ ├── deploy-guide.cn.md │ │ │ ├── deploy-guide.en.md │ │ │ ├── dump.cn.md │ │ │ ├── dump.en.md │ │ │ ├── execution-monitor.cn.md │ │ │ ├── execution-monitor.en.md │ │ │ ├── web-console.cn.md │ │ │ └── web-console.en.md │ │ └── usage/ │ │ ├── _index.cn.md │ │ ├── _index.en.md │ │ ├── job-api/ │ │ │ ├── _index.cn.md │ │ │ ├── _index.en.md │ │ │ ├── java-api.cn.md │ │ │ ├── java-api.en.md │ │ │ ├── job-interface.cn.md │ │ │ ├── job-interface.en.md │ │ │ ├── spring-boot-starter.cn.md │ │ │ ├── spring-boot-starter.en.md │ │ │ ├── spring-namespace.cn.md │ │ │ └── spring-namespace.en.md │ │ ├── job-listener/ │ │ │ ├── _index.cn.md │ │ │ ├── _index.en.md │ │ │ ├── java-api.cn.md │ │ │ ├── java-api.en.md │ │ │ ├── listener-interface.cn.md │ │ │ ├── listener-interface.en.md │ │ │ ├── spring-namespace.cn.md │ │ │ └── spring-namespace.en.md │ │ ├── operation-api/ │ │ │ ├── _index.cn.md │ │ │ └── _index.en.md │ │ └── tracing/ │ │ ├── _index.cn.md │ │ ├── _index.en.md │ │ ├── java-api.cn.md │ │ ├── java-api.en.md │ │ ├── spring-boot-starter.cn.md │ │ ├── spring-boot-starter.en.md │ │ ├── spring-namespace.cn.md │ │ ├── spring-namespace.en.md │ │ ├── table-structure.cn.md │ │ └── table-structure.en.md │ ├── i18n/ │ │ └── cn.toml │ ├── layouts/ │ │ ├── index.html │ │ ├── partials/ │ │ │ ├── favicon.html │ │ │ ├── javascript.html │ │ │ ├── logo.html │ │ │ ├── menu-footer.html │ │ │ ├── style.html │ │ │ └── toc.html │ │ └── shortcodes/ │ │ └── bilibili.html │ ├── static/ │ │ ├── css/ │ │ │ ├── style.css │ │ │ ├── theme-black.css │ │ │ ├── theme-mine.css │ │ │ └── theme-white.css │ │ └── data/ │ │ └── chart.js │ └── themes/ │ └── hugo-theme-learn/ │ ├── LICENSE.md │ ├── README.md │ ├── archetypes/ │ │ ├── chapter.md │ │ └── default.md │ ├── exampleSite/ │ │ ├── LICENSE.md │ │ ├── config.toml │ │ ├── content/ │ │ │ ├── _index.en.md │ │ │ ├── _index.fr.md │ │ │ ├── basics/ │ │ │ │ ├── _index.en.md │ │ │ │ ├── _index.fr.md │ │ │ │ ├── configuration/ │ │ │ │ │ ├── _index.en.md │ │ │ │ │ └── _index.fr.md │ │ │ │ ├── installation/ │ │ │ │ │ ├── _index.en.md │ │ │ │ │ └── _index.fr.md │ │ │ │ ├── requirements/ │ │ │ │ │ ├── _index.en.md │ │ │ │ │ └── _index.fr.md │ │ │ │ └── style-customization/ │ │ │ │ ├── _index.en.md │ │ │ │ └── _index.fr.md │ │ │ ├── cont/ │ │ │ │ ├── _index.en.md │ │ │ │ ├── _index.fr.md │ │ │ │ ├── archetypes.en.md │ │ │ │ ├── archetypes.fr.md │ │ │ │ ├── i18n/ │ │ │ │ │ ├── _index.en.md │ │ │ │ │ └── _index.fr.md │ │ │ │ ├── markdown.en.md │ │ │ │ ├── markdown.fr.md │ │ │ │ ├── menushortcuts.en.md │ │ │ │ ├── menushortcuts.fr.md │ │ │ │ └── pages/ │ │ │ │ ├── _index.en.md │ │ │ │ └── _index.fr.md │ │ │ ├── credits.en.md │ │ │ ├── credits.fr.md │ │ │ ├── shortcodes/ │ │ │ │ ├── _index.en.md │ │ │ │ ├── _index.fr.md │ │ │ │ ├── attachments.en.md │ │ │ │ ├── attachments.fr.md │ │ │ │ ├── button.en.md │ │ │ │ ├── button.fr.md │ │ │ │ ├── children/ │ │ │ │ │ ├── _index.en.md │ │ │ │ │ ├── _index.fr.md │ │ │ │ │ ├── children-1/ │ │ │ │ │ │ ├── _index.en.md │ │ │ │ │ │ ├── _index.fr.md │ │ │ │ │ │ └── children-1-1/ │ │ │ │ │ │ ├── _index.en.md │ │ │ │ │ │ ├── _index.fr.md │ │ │ │ │ │ └── children-1-1-1/ │ │ │ │ │ │ ├── _index.en.md │ │ │ │ │ │ ├── _index.fr.md │ │ │ │ │ │ └── children-1-1-1-1/ │ │ │ │ │ │ ├── _index.en.md │ │ │ │ │ │ ├── _index.fr.md │ │ │ │ │ │ └── children-1-1-1-1-1/ │ │ │ │ │ │ ├── _index.en.md │ │ │ │ │ │ └── _index.fr.md │ │ │ │ │ ├── children-2/ │ │ │ │ │ │ ├── _index.en.md │ │ │ │ │ │ ├── _index.fr.md │ │ │ │ │ │ ├── test3.en.md │ │ │ │ │ │ └── test3.fr.md │ │ │ │ │ ├── children-3/ │ │ │ │ │ │ ├── _index.en.md │ │ │ │ │ │ └── _index.fr.md │ │ │ │ │ ├── children-4/ │ │ │ │ │ │ ├── _index.en.md │ │ │ │ │ │ └── _index.fr.md │ │ │ │ │ ├── test.en.md │ │ │ │ │ └── test.fr.md │ │ │ │ ├── expand.en.md │ │ │ │ ├── expand.fr.md │ │ │ │ ├── mermaid.en.md │ │ │ │ ├── mermaid.fr.md │ │ │ │ ├── notice.en.md │ │ │ │ ├── notice.fr.md │ │ │ │ ├── siteparam.en.md │ │ │ │ └── siteparam.fr.md │ │ │ ├── showcase.en.md │ │ │ └── showcase.fr.md │ │ ├── layouts/ │ │ │ ├── partials/ │ │ │ │ ├── custom-footer.html │ │ │ │ ├── logo.html │ │ │ │ └── menu-footer.html │ │ │ └── shortcodes/ │ │ │ └── ghcontributors.html │ │ └── static/ │ │ └── css/ │ │ └── theme-mine.css │ ├── i18n/ │ │ ├── en.toml │ │ ├── es.toml │ │ ├── fr.toml │ │ └── pt.toml │ ├── layouts/ │ │ ├── 404.html │ │ ├── _default/ │ │ │ ├── list.html │ │ │ └── single.html │ │ ├── index.html │ │ ├── index.json │ │ ├── partials/ │ │ │ ├── change-theme.html │ │ │ ├── custom-comments.html │ │ │ ├── custom-footer.html │ │ │ ├── custom-header.html │ │ │ ├── favicon.html │ │ │ ├── footer.html │ │ │ ├── header.html │ │ │ ├── language.html │ │ │ ├── logo.html │ │ │ ├── menu-footer.html │ │ │ ├── menu.html │ │ │ ├── meta.html │ │ │ ├── search.html │ │ │ └── toc.html │ │ └── shortcodes/ │ │ ├── attachments.html │ │ ├── button.html │ │ ├── children.html │ │ ├── expand.html │ │ ├── mermaid.html │ │ ├── notice.html │ │ ├── ref.html │ │ ├── relref.html │ │ └── siteparam.html │ ├── static/ │ │ ├── css/ │ │ │ ├── auto-complete.css │ │ │ ├── hugo-theme.css │ │ │ ├── hybrid.css │ │ │ ├── nucleus.css │ │ │ ├── theme-blue.css │ │ │ ├── theme-green.css │ │ │ ├── theme-red.css │ │ │ └── theme.css │ │ ├── fonts/ │ │ │ └── FontAwesome.otf │ │ └── js/ │ │ ├── auto-complete.js │ │ ├── highlight.pack.js │ │ ├── hugo-learn.js │ │ ├── jquery.sticky.js │ │ ├── learn.js │ │ ├── modernizr.custom.71422.js │ │ └── search.js │ ├── theme.toml │ └── wercker.yml ├── ecosystem/ │ ├── error-handler/ │ │ ├── dingtalk/ │ │ │ ├── pom.xml │ │ │ └── src/ │ │ │ ├── main/ │ │ │ │ ├── java/ │ │ │ │ │ └── org/ │ │ │ │ │ └── apache/ │ │ │ │ │ └── shardingsphere/ │ │ │ │ │ └── elasticjob/ │ │ │ │ │ └── error/ │ │ │ │ │ └── handler/ │ │ │ │ │ └── dingtalk/ │ │ │ │ │ ├── DingtalkJobErrorHandler.java │ │ │ │ │ ├── DingtalkJobErrorHandlerPropertiesValidator.java │ │ │ │ │ └── DingtalkPropertiesConstants.java │ │ │ │ └── resources/ │ │ │ │ └── META-INF/ │ │ │ │ └── services/ │ │ │ │ ├── org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler │ │ │ │ └── org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator │ │ │ └── test/ │ │ │ ├── java/ │ │ │ │ └── org/ │ │ │ │ └── apache/ │ │ │ │ └── shardingsphere/ │ │ │ │ └── elasticjob/ │ │ │ │ └── error/ │ │ │ │ └── handler/ │ │ │ │ └── dingtalk/ │ │ │ │ ├── DingtalkJobErrorHandlerPropertiesValidatorTest.java │ │ │ │ ├── DingtalkJobErrorHandlerTest.java │ │ │ │ └── fixture/ │ │ │ │ └── DingtalkInternalController.java │ │ │ └── resources/ │ │ │ └── logback-test.xml │ │ ├── email/ │ │ │ ├── pom.xml │ │ │ └── src/ │ │ │ ├── main/ │ │ │ │ ├── java/ │ │ │ │ │ └── org/ │ │ │ │ │ └── apache/ │ │ │ │ │ └── shardingsphere/ │ │ │ │ │ └── elasticjob/ │ │ │ │ │ └── error/ │ │ │ │ │ └── handler/ │ │ │ │ │ └── email/ │ │ │ │ │ ├── EmailJobErrorHandler.java │ │ │ │ │ ├── EmailJobErrorHandlerPropertiesValidator.java │ │ │ │ │ └── EmailPropertiesConstants.java │ │ │ │ └── resources/ │ │ │ │ └── META-INF/ │ │ │ │ └── services/ │ │ │ │ ├── org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler │ │ │ │ └── org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator │ │ │ └── test/ │ │ │ ├── java/ │ │ │ │ └── org/ │ │ │ │ └── apache/ │ │ │ │ └── shardingsphere/ │ │ │ │ └── elasticjob/ │ │ │ │ └── error/ │ │ │ │ └── handler/ │ │ │ │ └── email/ │ │ │ │ ├── EmailJobErrorHandlerPropertiesValidatorTest.java │ │ │ │ └── EmailJobErrorHandlerTest.java │ │ │ └── resources/ │ │ │ └── logback-test.xml │ │ ├── normal/ │ │ │ ├── pom.xml │ │ │ └── src/ │ │ │ ├── main/ │ │ │ │ ├── java/ │ │ │ │ │ └── org/ │ │ │ │ │ └── apache/ │ │ │ │ │ └── shardingsphere/ │ │ │ │ │ └── elasticjob/ │ │ │ │ │ └── error/ │ │ │ │ │ └── handler/ │ │ │ │ │ └── normal/ │ │ │ │ │ ├── IgnoreJobErrorHandler.java │ │ │ │ │ ├── LogJobErrorHandler.java │ │ │ │ │ └── ThrowJobErrorHandler.java │ │ │ │ └── resources/ │ │ │ │ └── META-INF/ │ │ │ │ └── services/ │ │ │ │ └── org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler │ │ │ └── test/ │ │ │ ├── java/ │ │ │ │ └── org/ │ │ │ │ └── apache/ │ │ │ │ └── shardingsphere/ │ │ │ │ └── elasticjob/ │ │ │ │ └── error/ │ │ │ │ └── handler/ │ │ │ │ └── normal/ │ │ │ │ ├── IgnoreJobErrorHandlerTest.java │ │ │ │ ├── LogJobErrorHandlerTest.java │ │ │ │ └── ThrowJobErrorHandlerTest.java │ │ │ └── resources/ │ │ │ └── logback-test.xml │ │ ├── pom.xml │ │ └── wechat/ │ │ ├── pom.xml │ │ └── src/ │ │ ├── main/ │ │ │ ├── java/ │ │ │ │ └── org/ │ │ │ │ └── apache/ │ │ │ │ └── shardingsphere/ │ │ │ │ └── elasticjob/ │ │ │ │ └── error/ │ │ │ │ └── handler/ │ │ │ │ └── wechat/ │ │ │ │ ├── WechatJobErrorHandler.java │ │ │ │ ├── WechatJobErrorHandlerPropertiesValidator.java │ │ │ │ └── WechatPropertiesConstants.java │ │ │ └── resources/ │ │ │ └── META-INF/ │ │ │ └── services/ │ │ │ ├── org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler │ │ │ └── org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator │ │ └── test/ │ │ ├── java/ │ │ │ └── org/ │ │ │ └── apache/ │ │ │ └── shardingsphere/ │ │ │ └── elasticjob/ │ │ │ └── error/ │ │ │ └── handler/ │ │ │ └── wechat/ │ │ │ ├── WechatJobErrorHandlerPropertiesValidatorTest.java │ │ │ ├── WechatJobErrorHandlerTest.java │ │ │ └── fixture/ │ │ │ └── WechatInternalController.java │ │ └── resources/ │ │ └── logback-test.xml │ ├── executor/ │ │ ├── dataflow/ │ │ │ ├── pom.xml │ │ │ └── src/ │ │ │ ├── main/ │ │ │ │ ├── java/ │ │ │ │ │ └── org/ │ │ │ │ │ └── apache/ │ │ │ │ │ └── shardingsphere/ │ │ │ │ │ └── elasticjob/ │ │ │ │ │ └── dataflow/ │ │ │ │ │ ├── executor/ │ │ │ │ │ │ └── DataflowJobExecutor.java │ │ │ │ │ ├── job/ │ │ │ │ │ │ └── DataflowJob.java │ │ │ │ │ └── props/ │ │ │ │ │ └── DataflowJobProperties.java │ │ │ │ └── resources/ │ │ │ │ └── META-INF/ │ │ │ │ └── services/ │ │ │ │ └── org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor │ │ │ └── test/ │ │ │ └── java/ │ │ │ └── org/ │ │ │ └── apache/ │ │ │ └── shardingsphere/ │ │ │ └── elasticjob/ │ │ │ └── dataflow/ │ │ │ └── executor/ │ │ │ └── DataflowJobExecutorTest.java │ │ ├── http/ │ │ │ ├── pom.xml │ │ │ └── src/ │ │ │ ├── main/ │ │ │ │ ├── java/ │ │ │ │ │ └── org/ │ │ │ │ │ └── apache/ │ │ │ │ │ └── shardingsphere/ │ │ │ │ │ └── elasticjob/ │ │ │ │ │ └── http/ │ │ │ │ │ ├── executor/ │ │ │ │ │ │ └── HttpJobExecutor.java │ │ │ │ │ ├── pojo/ │ │ │ │ │ │ └── HttpParam.java │ │ │ │ │ └── props/ │ │ │ │ │ └── HttpJobProperties.java │ │ │ │ └── resources/ │ │ │ │ └── META-INF/ │ │ │ │ └── services/ │ │ │ │ └── org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor │ │ │ └── test/ │ │ │ ├── java/ │ │ │ │ └── org/ │ │ │ │ └── apache/ │ │ │ │ └── shardingsphere/ │ │ │ │ └── elasticjob/ │ │ │ │ └── http/ │ │ │ │ ├── executor/ │ │ │ │ │ ├── HttpJobExecutorTest.java │ │ │ │ │ └── fixture/ │ │ │ │ │ └── InternalController.java │ │ │ │ └── pojo/ │ │ │ │ └── HttpParamTest.java │ │ │ └── resources/ │ │ │ └── logback-test.xml │ │ ├── pom.xml │ │ ├── script/ │ │ │ ├── pom.xml │ │ │ └── src/ │ │ │ ├── main/ │ │ │ │ ├── java/ │ │ │ │ │ └── org/ │ │ │ │ │ └── apache/ │ │ │ │ │ └── shardingsphere/ │ │ │ │ │ └── elasticjob/ │ │ │ │ │ └── script/ │ │ │ │ │ ├── executor/ │ │ │ │ │ │ └── ScriptJobExecutor.java │ │ │ │ │ └── props/ │ │ │ │ │ └── ScriptJobProperties.java │ │ │ │ └── resources/ │ │ │ │ └── META-INF/ │ │ │ │ └── services/ │ │ │ │ └── org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor │ │ │ └── test/ │ │ │ └── java/ │ │ │ └── org/ │ │ │ └── apache/ │ │ │ └── shardingsphere/ │ │ │ └── elasticjob/ │ │ │ └── script/ │ │ │ └── ScriptJobExecutorTest.java │ │ └── simple/ │ │ ├── pom.xml │ │ └── src/ │ │ ├── main/ │ │ │ ├── java/ │ │ │ │ └── org/ │ │ │ │ └── apache/ │ │ │ │ └── shardingsphere/ │ │ │ │ └── elasticjob/ │ │ │ │ └── simple/ │ │ │ │ ├── executor/ │ │ │ │ │ └── SimpleJobExecutor.java │ │ │ │ └── job/ │ │ │ │ └── SimpleJob.java │ │ │ └── resources/ │ │ │ └── META-INF/ │ │ │ └── services/ │ │ │ └── org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor │ │ └── test/ │ │ └── java/ │ │ └── org/ │ │ └── apache/ │ │ └── shardingsphere/ │ │ └── elasticjob/ │ │ └── simple/ │ │ ├── executor/ │ │ │ └── SimpleJobExecutorTest.java │ │ └── job/ │ │ └── FooSimpleJob.java │ ├── pom.xml │ └── tracing/ │ ├── pom.xml │ └── rdb/ │ ├── pom.xml │ └── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── org/ │ │ │ └── apache/ │ │ │ └── shardingsphere/ │ │ │ └── elasticjob/ │ │ │ └── tracing/ │ │ │ └── rdb/ │ │ │ ├── config/ │ │ │ │ └── RDBTracingStorageConfiguration.java │ │ │ ├── listener/ │ │ │ │ ├── RDBTracingListener.java │ │ │ │ └── RDBTracingListenerFactory.java │ │ │ ├── storage/ │ │ │ │ ├── converter/ │ │ │ │ │ └── RDBTracingStorageConfigurationConverter.java │ │ │ │ ├── datasource/ │ │ │ │ │ ├── DataSourceRegistry.java │ │ │ │ │ └── JDBCParameterDecorator.java │ │ │ │ ├── repository/ │ │ │ │ │ └── RDBJobEventRepository.java │ │ │ │ ├── sql/ │ │ │ │ │ ├── RDBStorageSQLMapper.java │ │ │ │ │ └── SQLPropertiesFactory.java │ │ │ │ └── type/ │ │ │ │ ├── TracingStorageDatabaseType.java │ │ │ │ └── impl/ │ │ │ │ ├── DB2TracingStorageDatabaseType.java │ │ │ │ ├── DefaultTracingStorageDatabaseType.java │ │ │ │ ├── GaussDBTracingStorageDatabaseType.java │ │ │ │ ├── H2TracingStorageDatabaseType.java │ │ │ │ ├── MySQLTracingStorageDatabaseType.java │ │ │ │ ├── OracleTracingStorageDatabaseType.java │ │ │ │ ├── PostgreSQLTracingStorageDatabaseType.java │ │ │ │ └── SQLServerTracingStorageDatabaseType.java │ │ │ └── yaml/ │ │ │ ├── YamlDataSourceConfiguration.java │ │ │ └── YamlDataSourceConfigurationConverter.java │ │ └── resources/ │ │ └── META-INF/ │ │ ├── services/ │ │ │ ├── org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListenerFactory │ │ │ ├── org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfigurationConverter │ │ │ ├── org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter │ │ │ └── org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType │ │ └── sql/ │ │ ├── DB2.properties │ │ ├── GaussDB.properties │ │ ├── H2.properties │ │ ├── MySQL.properties │ │ ├── Oracle.properties │ │ ├── PostgreSQL.properties │ │ ├── SQL92.properties │ │ └── SQLServer.properties │ └── test/ │ ├── java/ │ │ └── org/ │ │ └── apache/ │ │ └── shardingsphere/ │ │ └── elasticjob/ │ │ └── tracing/ │ │ └── rdb/ │ │ ├── config/ │ │ │ └── RDBTracingStorageConfigurationTest.java │ │ ├── listener/ │ │ │ ├── RDBTracingListenerFactoryTest.java │ │ │ └── RDBTracingListenerTest.java │ │ ├── storage/ │ │ │ ├── converter/ │ │ │ │ └── RDBTracingStorageConfigurationConverterTest.java │ │ │ ├── datasource/ │ │ │ │ └── DataSourceRegistryTest.java │ │ │ └── repository/ │ │ │ └── RDBJobEventRepositoryTest.java │ │ └── yaml/ │ │ └── YamlRDBTracingStorageConfigurationConverterTest.java │ └── resources/ │ └── logback-test.xml ├── examples/ │ ├── README.md │ ├── elasticjob-example-embed-zk/ │ │ ├── pom.xml │ │ └── src/ │ │ └── main/ │ │ └── java/ │ │ └── org/ │ │ └── apache/ │ │ └── shardingsphere/ │ │ └── elasticjob/ │ │ └── example/ │ │ └── EmbedZookeeperServer.java │ ├── elasticjob-example-java/ │ │ ├── pom.xml │ │ └── src/ │ │ └── main/ │ │ ├── java/ │ │ │ └── org/ │ │ │ └── apache/ │ │ │ └── shardingsphere/ │ │ │ └── elasticjob/ │ │ │ └── example/ │ │ │ └── JavaMain.java │ │ └── resources/ │ │ ├── logback.xml │ │ └── script/ │ │ ├── demo.bat │ │ └── demo.sh │ ├── elasticjob-example-jobs/ │ │ ├── pom.xml │ │ └── src/ │ │ └── main/ │ │ └── java/ │ │ └── org/ │ │ └── apache/ │ │ └── shardingsphere/ │ │ └── elasticjob/ │ │ └── example/ │ │ ├── fixture/ │ │ │ ├── entity/ │ │ │ │ └── Foo.java │ │ │ └── repository/ │ │ │ ├── FooRepository.java │ │ │ └── FooRepositoryFactory.java │ │ └── job/ │ │ ├── dataflow/ │ │ │ ├── JavaDataflowJob.java │ │ │ └── SpringDataflowJob.java │ │ └── simple/ │ │ ├── JavaOccurErrorJob.java │ │ ├── JavaSimpleJob.java │ │ └── SpringSimpleJob.java │ ├── elasticjob-example-spring/ │ │ ├── pom.xml │ │ └── src/ │ │ └── main/ │ │ ├── java/ │ │ │ └── org/ │ │ │ └── apache/ │ │ │ └── shardingsphere/ │ │ │ └── elasticjob/ │ │ │ └── example/ │ │ │ └── SpringMain.java │ │ └── resources/ │ │ ├── META-INF/ │ │ │ └── application-context.xml │ │ ├── conf/ │ │ │ ├── job.properties │ │ │ └── reg.properties │ │ ├── logback.xml │ │ └── script/ │ │ ├── demo.bat │ │ └── demo.sh │ ├── elasticjob-example-springboot/ │ │ ├── pom.xml │ │ └── src/ │ │ └── main/ │ │ ├── java/ │ │ │ └── org/ │ │ │ └── apache/ │ │ │ └── shardingsphere/ │ │ │ └── elasticjob/ │ │ │ └── example/ │ │ │ ├── SpringBootMain.java │ │ │ ├── controller/ │ │ │ │ └── OneOffJobController.java │ │ │ ├── entity/ │ │ │ │ └── Foo.java │ │ │ ├── job/ │ │ │ │ ├── SpringBootDataflowJob.java │ │ │ │ ├── SpringBootOccurErrorNoticeDingtalkJob.java │ │ │ │ ├── SpringBootOccurErrorNoticeEmailJob.java │ │ │ │ ├── SpringBootOccurErrorNoticeWechatJob.java │ │ │ │ └── SpringBootSimpleJob.java │ │ │ └── repository/ │ │ │ └── FooRepository.java │ │ └── resources/ │ │ ├── application-dev.yml │ │ ├── application-prod.yml │ │ ├── application.yml │ │ └── logback.xml │ └── pom.xml ├── kernel/ │ ├── pom.xml │ └── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── org/ │ │ │ └── apache/ │ │ │ └── shardingsphere/ │ │ │ └── elasticjob/ │ │ │ └── kernel/ │ │ │ ├── executor/ │ │ │ │ ├── ElasticJobExecutor.java │ │ │ │ ├── error/ │ │ │ │ │ └── handler/ │ │ │ │ │ └── JobErrorHandlerReloader.java │ │ │ │ ├── facade/ │ │ │ │ │ ├── AbstractJobFacade.java │ │ │ │ │ ├── JobFacade.java │ │ │ │ │ ├── JobJobRuntimeServiceImpl.java │ │ │ │ │ ├── ShardingJobFacade.java │ │ │ │ │ └── SingleShardingJobFacade.java │ │ │ │ ├── item/ │ │ │ │ │ └── JobItemExecutorFactory.java │ │ │ │ └── threadpool/ │ │ │ │ ├── ElasticJobExecutorService.java │ │ │ │ ├── ExecutorServiceReloader.java │ │ │ │ ├── JobExecutorThreadPoolSizeProvider.java │ │ │ │ └── type/ │ │ │ │ ├── CPUUsageJobExecutorThreadPoolSizeProvider.java │ │ │ │ └── SingleThreadJobExecutorThreadPoolSizeProvider.java │ │ │ ├── infra/ │ │ │ │ ├── env/ │ │ │ │ │ ├── HostException.java │ │ │ │ │ └── IpUtils.java │ │ │ │ ├── exception/ │ │ │ │ │ ├── ExceptionUtils.java │ │ │ │ │ ├── JobConfigurationException.java │ │ │ │ │ ├── JobExecutionEnvironmentException.java │ │ │ │ │ ├── JobExecutionException.java │ │ │ │ │ ├── JobSystemException.java │ │ │ │ │ └── PropertiesPreconditions.java │ │ │ │ ├── json/ │ │ │ │ │ └── GsonFactory.java │ │ │ │ ├── time/ │ │ │ │ │ └── TimeService.java │ │ │ │ ├── util/ │ │ │ │ │ ├── BlockUtils.java │ │ │ │ │ └── SensitiveInfoUtils.java │ │ │ │ └── yaml/ │ │ │ │ ├── YamlEngine.java │ │ │ │ └── representer/ │ │ │ │ ├── DefaultYamlTupleProcessor.java │ │ │ │ └── ElasticJobYamlRepresenter.java │ │ │ ├── internal/ │ │ │ │ ├── annotation/ │ │ │ │ │ └── JobAnnotationBuilder.java │ │ │ │ ├── config/ │ │ │ │ │ ├── ConfigurationNode.java │ │ │ │ │ ├── ConfigurationService.java │ │ │ │ │ ├── JobConfigurationPOJO.java │ │ │ │ │ └── RescheduleListenerManager.java │ │ │ │ ├── context/ │ │ │ │ │ └── TaskContext.java │ │ │ │ ├── election/ │ │ │ │ │ ├── ElectionListenerManager.java │ │ │ │ │ ├── LeaderNode.java │ │ │ │ │ └── LeaderService.java │ │ │ │ ├── failover/ │ │ │ │ │ ├── FailoverListenerManager.java │ │ │ │ │ ├── FailoverNode.java │ │ │ │ │ └── FailoverService.java │ │ │ │ ├── guarantee/ │ │ │ │ │ ├── GuaranteeListenerManager.java │ │ │ │ │ ├── GuaranteeNode.java │ │ │ │ │ └── GuaranteeService.java │ │ │ │ ├── instance/ │ │ │ │ │ ├── InstanceNode.java │ │ │ │ │ ├── InstanceService.java │ │ │ │ │ └── ShutdownListenerManager.java │ │ │ │ ├── listener/ │ │ │ │ │ ├── AbstractListenerManager.java │ │ │ │ │ ├── ListenerManager.java │ │ │ │ │ ├── ListenerNotifierManager.java │ │ │ │ │ └── RegistryCenterConnectionStateListener.java │ │ │ │ ├── reconcile/ │ │ │ │ │ └── ReconcileService.java │ │ │ │ ├── schedule/ │ │ │ │ │ ├── JobRegistry.java │ │ │ │ │ ├── JobScheduleController.java │ │ │ │ │ ├── JobScheduler.java │ │ │ │ │ ├── JobShutdownHookPlugin.java │ │ │ │ │ ├── JobTriggerListener.java │ │ │ │ │ ├── LiteJob.java │ │ │ │ │ └── SchedulerFacade.java │ │ │ │ ├── server/ │ │ │ │ │ ├── ServerNode.java │ │ │ │ │ ├── ServerService.java │ │ │ │ │ └── ServerStatus.java │ │ │ │ ├── setup/ │ │ │ │ │ ├── DefaultJobClassNameProvider.java │ │ │ │ │ ├── JobClassNameProvider.java │ │ │ │ │ ├── JobClassNameProviderFactory.java │ │ │ │ │ └── SetUpFacade.java │ │ │ │ ├── sharding/ │ │ │ │ │ ├── ExecutionContextService.java │ │ │ │ │ ├── ExecutionService.java │ │ │ │ │ ├── JobInstance.java │ │ │ │ │ ├── MonitorExecutionListenerManager.java │ │ │ │ │ ├── ShardingItemParameters.java │ │ │ │ │ ├── ShardingListenerManager.java │ │ │ │ │ ├── ShardingNode.java │ │ │ │ │ ├── ShardingService.java │ │ │ │ │ └── strategy/ │ │ │ │ │ ├── JobShardingStrategy.java │ │ │ │ │ └── type/ │ │ │ │ │ ├── AverageAllocationJobShardingStrategy.java │ │ │ │ │ ├── OdevitySortByNameJobShardingStrategy.java │ │ │ │ │ ├── RoundRobinByNameJobShardingStrategy.java │ │ │ │ │ └── SingleShardingBalanceJobShardingStrategy.java │ │ │ │ ├── snapshot/ │ │ │ │ │ └── SnapshotService.java │ │ │ │ ├── storage/ │ │ │ │ │ ├── JobNodePath.java │ │ │ │ │ └── JobNodeStorage.java │ │ │ │ └── trigger/ │ │ │ │ ├── TriggerListenerManager.java │ │ │ │ ├── TriggerNode.java │ │ │ │ └── TriggerService.java │ │ │ ├── listener/ │ │ │ │ └── AbstractDistributeOnceElasticJobListener.java │ │ │ └── tracing/ │ │ │ ├── config/ │ │ │ │ └── TracingConfiguration.java │ │ │ ├── event/ │ │ │ │ └── JobTracingEventBus.java │ │ │ ├── exception/ │ │ │ │ └── TracingStorageUnavailableException.java │ │ │ ├── storage/ │ │ │ │ └── TracingStorageConverterFactory.java │ │ │ └── yaml/ │ │ │ ├── YamlTracingConfiguration.java │ │ │ ├── YamlTracingConfigurationConverter.java │ │ │ └── YamlTracingStorageConfiguration.java │ │ └── resources/ │ │ └── META-INF/ │ │ └── services/ │ │ ├── org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.JobExecutorThreadPoolSizeProvider │ │ ├── org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.JobShardingStrategy │ │ └── org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter │ └── test/ │ ├── java/ │ │ └── org/ │ │ └── apache/ │ │ └── shardingsphere/ │ │ └── elasticjob/ │ │ └── kernel/ │ │ ├── executor/ │ │ │ ├── ElasticJobExecutorTest.java │ │ │ ├── error/ │ │ │ │ └── handler/ │ │ │ │ ├── JobErrorHandlerReloaderTest.java │ │ │ │ └── fixture/ │ │ │ │ ├── BarJobErrorHandlerFixture.java │ │ │ │ └── FooJobErrorHandlerFixture.java │ │ │ ├── facade/ │ │ │ │ ├── ShardingJobFacadeTest.java │ │ │ │ └── SingleShardingJobFacadeTest.java │ │ │ ├── item/ │ │ │ │ └── JobItemExecutorFactoryTest.java │ │ │ └── threadpool/ │ │ │ ├── ElasticJobExecutorServiceTest.java │ │ │ ├── ExecutorServiceReloaderTest.java │ │ │ └── type/ │ │ │ ├── CPUUsageJobExecutorThreadPoolSizeProviderTest.java │ │ │ └── SingleThreadJobExecutorThreadPoolSizeProviderTest.java │ │ ├── fixture/ │ │ │ ├── YamlConstants.java │ │ │ ├── executor/ │ │ │ │ ├── ClassedFooJobExecutor.java │ │ │ │ └── TypedFooJobExecutor.java │ │ │ └── job/ │ │ │ ├── DetailedFooJob.java │ │ │ ├── FailedJob.java │ │ │ └── FooJob.java │ │ ├── infra/ │ │ │ ├── env/ │ │ │ │ ├── HostExceptionTest.java │ │ │ │ └── IpUtilsTest.java │ │ │ ├── exception/ │ │ │ │ ├── ExceptionUtilsTest.java │ │ │ │ ├── JobConfigurationExceptionTest.java │ │ │ │ ├── JobExecutionEnvironmentExceptionTest.java │ │ │ │ ├── JobSystemExceptionTest.java │ │ │ │ └── PropertiesPreconditionsTest.java │ │ │ ├── json/ │ │ │ │ └── GsonFactoryTest.java │ │ │ ├── time/ │ │ │ │ └── TimeServiceTest.java │ │ │ ├── util/ │ │ │ │ └── SensitiveInfoUtilsTest.java │ │ │ └── yaml/ │ │ │ ├── YamlEngineTest.java │ │ │ └── fixture/ │ │ │ └── FooYamlConfiguration.java │ │ ├── internal/ │ │ │ ├── annotation/ │ │ │ │ ├── JobAnnotationBuilderTest.java │ │ │ │ └── fixture/ │ │ │ │ └── AnnotationJobFixture.java │ │ │ ├── config/ │ │ │ │ ├── ConfigurationNodeTest.java │ │ │ │ ├── ConfigurationServiceTest.java │ │ │ │ ├── JobConfigurationPOJOTest.java │ │ │ │ └── RescheduleListenerManagerTest.java │ │ │ ├── context/ │ │ │ │ ├── TaskContextTest.java │ │ │ │ └── fixture/ │ │ │ │ └── TaskNode.java │ │ │ ├── election/ │ │ │ │ ├── ElectionListenerManagerTest.java │ │ │ │ ├── LeaderNodeTest.java │ │ │ │ └── LeaderServiceTest.java │ │ │ ├── failover/ │ │ │ │ ├── FailoverListenerManagerTest.java │ │ │ │ ├── FailoverNodeTest.java │ │ │ │ └── FailoverServiceTest.java │ │ │ ├── guarantee/ │ │ │ │ ├── GuaranteeListenerManagerTest.java │ │ │ │ ├── GuaranteeNodeTest.java │ │ │ │ └── GuaranteeServiceTest.java │ │ │ ├── instance/ │ │ │ │ ├── InstanceNodeTest.java │ │ │ │ ├── InstanceServiceTest.java │ │ │ │ └── ShutdownListenerManagerTest.java │ │ │ ├── listener/ │ │ │ │ ├── ListenerManagerTest.java │ │ │ │ ├── ListenerNotifierManagerTest.java │ │ │ │ └── RegistryCenterConnectionStateListenerTest.java │ │ │ ├── reconcile/ │ │ │ │ └── ReconcileServiceTest.java │ │ │ ├── schedule/ │ │ │ │ ├── JobRegistryTest.java │ │ │ │ ├── JobScheduleControllerTest.java │ │ │ │ ├── JobTriggerListenerTest.java │ │ │ │ └── SchedulerFacadeTest.java │ │ │ ├── server/ │ │ │ │ ├── ServerNodeTest.java │ │ │ │ └── ServerServiceTest.java │ │ │ ├── setup/ │ │ │ │ ├── DefaultJobClassNameProviderTest.java │ │ │ │ ├── JobClassNameProviderFactoryTest.java │ │ │ │ └── SetUpFacadeTest.java │ │ │ ├── sharding/ │ │ │ │ ├── ExecutionContextServiceTest.java │ │ │ │ ├── ExecutionServiceTest.java │ │ │ │ ├── JobInstanceTest.java │ │ │ │ ├── MonitorExecutionListenerManagerTest.java │ │ │ │ ├── ShardingItemParametersTest.java │ │ │ │ ├── ShardingListenerManagerTest.java │ │ │ │ ├── ShardingNodeTest.java │ │ │ │ ├── ShardingServiceTest.java │ │ │ │ └── strategy/ │ │ │ │ └── type/ │ │ │ │ ├── AverageAllocationJobShardingStrategyTest.java │ │ │ │ ├── OdevitySortByNameJobShardingStrategyTest.java │ │ │ │ ├── RotateServerByNameJobShardingStrategyTest.java │ │ │ │ └── SingleShardingBalanceJobShardingStrategyTest.java │ │ │ ├── storage/ │ │ │ │ ├── JobNodePathTest.java │ │ │ │ └── JobNodeStorageTest.java │ │ │ └── trigger/ │ │ │ └── TriggerListenerManagerTest.java │ │ ├── listener/ │ │ │ ├── DistributeOnceElasticJobListenerTest.java │ │ │ └── fixture/ │ │ │ ├── ElasticJobListenerCaller.java │ │ │ ├── TestDistributeOnceElasticJobListener.java │ │ │ └── TestElasticJobListener.java │ │ └── tracing/ │ │ ├── event/ │ │ │ ├── JobExecutionEventTest.java │ │ │ └── JobTracingEventBusTest.java │ │ ├── fixture/ │ │ │ ├── config/ │ │ │ │ ├── TracingStorageConfigurationFixture.java │ │ │ │ ├── TracingStorageFixture.java │ │ │ │ └── TracingStorageFixtureConfigurationConverter.java │ │ │ └── listener/ │ │ │ ├── TracingListenerFixture.java │ │ │ └── TracingListenerFixtureFactory.java │ │ ├── storage/ │ │ │ └── TracingStorageConfigurationConverterFactoryTest.java │ │ └── yaml/ │ │ ├── YamlJobEventCallerConfiguration.java │ │ ├── YamlJobEventCallerConfigurationConverter.java │ │ └── YamlTracingConfigurationConverterTest.java │ └── resources/ │ ├── META-INF/ │ │ └── services/ │ │ ├── org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler │ │ ├── org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor │ │ ├── org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor │ │ ├── org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener │ │ ├── org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListenerFactory │ │ ├── org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfigurationConverter │ │ └── org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter │ └── logback-test.xml ├── lifecycle/ │ ├── pom.xml │ └── src/ │ ├── main/ │ │ └── java/ │ │ └── org/ │ │ └── apache/ │ │ └── shardingsphere/ │ │ └── elasticjob/ │ │ └── lifecycle/ │ │ ├── api/ │ │ │ ├── JobAPIFactory.java │ │ │ ├── JobConfigurationAPI.java │ │ │ ├── JobOperateAPI.java │ │ │ ├── JobStatisticsAPI.java │ │ │ ├── ServerStatisticsAPI.java │ │ │ ├── ShardingOperateAPI.java │ │ │ └── ShardingStatisticsAPI.java │ │ ├── domain/ │ │ │ ├── JobBriefInfo.java │ │ │ ├── ServerBriefInfo.java │ │ │ └── ShardingInfo.java │ │ └── internal/ │ │ ├── operate/ │ │ │ ├── JobOperateAPIImpl.java │ │ │ └── ShardingOperateAPIImpl.java │ │ ├── reg/ │ │ │ └── RegistryCenterFactory.java │ │ ├── settings/ │ │ │ └── JobConfigurationAPIImpl.java │ │ └── statistics/ │ │ ├── JobStatisticsAPIImpl.java │ │ ├── ServerStatisticsAPIImpl.java │ │ └── ShardingStatisticsAPIImpl.java │ └── test/ │ ├── java/ │ │ └── org/ │ │ └── apache/ │ │ └── shardingsphere/ │ │ └── elasticjob/ │ │ └── lifecycle/ │ │ ├── api/ │ │ │ └── JobAPIFactoryTest.java │ │ ├── domain/ │ │ │ └── ShardingStatusTest.java │ │ ├── fixture/ │ │ │ └── LifecycleYamlConstants.java │ │ └── internal/ │ │ ├── operate/ │ │ │ ├── JobOperateAPIImplTest.java │ │ │ └── ShardingOperateAPIImplTest.java │ │ ├── reg/ │ │ │ └── RegistryCenterFactoryTest.java │ │ ├── settings/ │ │ │ └── JobConfigurationAPIImplTest.java │ │ └── statistics/ │ │ ├── JobStatisticsAPIImplTest.java │ │ ├── ServerStatisticsAPIImplTest.java │ │ └── ShardingStatisticsAPIImplTest.java │ └── resources/ │ └── logback-test.xml ├── lombok.config ├── mvnw ├── mvnw.cmd ├── pom.xml ├── reachability-metadata/ │ ├── pom.xml │ └── src/ │ └── main/ │ └── resources/ │ └── META-INF/ │ └── native-image/ │ ├── org.apache.shardingsphere.elasticjob/ │ │ ├── elasticjob-reachability-metadata/ │ │ │ ├── reflect-config.json │ │ │ └── resource-config.json │ │ └── generated-reachability-metadata/ │ │ ├── jni-config.json │ │ ├── predefined-classes-config.json │ │ ├── proxy-config.json │ │ ├── reflect-config.json │ │ ├── resource-config.json │ │ └── serialization-config.json │ ├── org.apache.zookeeper/ │ │ └── zookeeper/ │ │ └── 3.9.3/ │ │ └── reflect-config.json │ └── org.hamcrest/ │ └── hamcrest/ │ └── 2.2/ │ └── reflect-config.json ├── registry-center/ │ ├── api/ │ │ ├── pom.xml │ │ └── src/ │ │ ├── main/ │ │ │ └── java/ │ │ │ └── org/ │ │ │ └── apache/ │ │ │ └── shardingsphere/ │ │ │ └── elasticjob/ │ │ │ └── reg/ │ │ │ ├── base/ │ │ │ │ ├── CoordinatorRegistryCenter.java │ │ │ │ ├── ElectionCandidate.java │ │ │ │ ├── LeaderExecutionCallback.java │ │ │ │ ├── RegistryCenter.java │ │ │ │ └── transaction/ │ │ │ │ └── TransactionOperation.java │ │ │ ├── exception/ │ │ │ │ ├── IgnoredExceptionProvider.java │ │ │ │ ├── RegException.java │ │ │ │ └── RegExceptionHandler.java │ │ │ └── listener/ │ │ │ ├── ConnectionStateChangedEventListener.java │ │ │ ├── DataChangedEvent.java │ │ │ └── DataChangedEventListener.java │ │ └── test/ │ │ └── java/ │ │ └── org/ │ │ └── apache/ │ │ └── shardingsphere/ │ │ └── elasticjob/ │ │ └── reg/ │ │ ├── base/ │ │ │ └── transaction/ │ │ │ └── TransactionOperationTest.java │ │ └── exception/ │ │ └── RegExceptionHandlerTest.java │ ├── pom.xml │ └── provider/ │ ├── pom.xml │ └── zookeeper-curator/ │ ├── pom.xml │ └── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── org/ │ │ │ └── apache/ │ │ │ └── shardingsphere/ │ │ │ └── elasticjob/ │ │ │ └── reg/ │ │ │ └── zookeeper/ │ │ │ ├── ZookeeperConfiguration.java │ │ │ ├── ZookeeperElectionService.java │ │ │ ├── ZookeeperRegistryCenter.java │ │ │ └── exception/ │ │ │ └── ZookeeperCuratorIgnoredExceptionProvider.java │ │ └── resources/ │ │ └── META-INF/ │ │ └── services/ │ │ └── org.apache.shardingsphere.elasticjob.reg.exception.IgnoredExceptionProvider │ └── test/ │ ├── java/ │ │ └── org/ │ │ └── apache/ │ │ └── shardingsphere/ │ │ └── elasticjob/ │ │ └── reg/ │ │ └── zookeeper/ │ │ ├── ZookeeperConfigurationTest.java │ │ ├── ZookeeperElectionServiceTest.java │ │ ├── ZookeeperRegistryCenterExecuteInLeaderTest.java │ │ ├── ZookeeperRegistryCenterForAuthTest.java │ │ ├── ZookeeperRegistryCenterInitFailureTest.java │ │ ├── ZookeeperRegistryCenterListenerTest.java │ │ ├── ZookeeperRegistryCenterMiscellaneousTest.java │ │ ├── ZookeeperRegistryCenterModifyTest.java │ │ ├── ZookeeperRegistryCenterQueryWithCacheTest.java │ │ ├── ZookeeperRegistryCenterQueryWithoutCacheTest.java │ │ ├── ZookeeperRegistryCenterTransactionTest.java │ │ ├── ZookeeperRegistryCenterWatchTest.java │ │ ├── env/ │ │ │ └── RegistryCenterEnvironmentPreparer.java │ │ └── exception/ │ │ └── ZookeeperCuratorIgnoredExceptionProviderTest.java │ └── resources/ │ ├── conf/ │ │ └── reg/ │ │ ├── local.properties │ │ └── local_overwrite.properties │ └── logback-test.xml ├── restful/ │ ├── README.md │ ├── pom.xml │ └── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── org/ │ │ │ └── apache/ │ │ │ └── shardingsphere/ │ │ │ └── elasticjob/ │ │ │ └── restful/ │ │ │ ├── Filter.java │ │ │ ├── Http.java │ │ │ ├── NettyRestfulService.java │ │ │ ├── NettyRestfulServiceConfiguration.java │ │ │ ├── RestfulController.java │ │ │ ├── RestfulService.java │ │ │ ├── annotation/ │ │ │ │ ├── ContextPath.java │ │ │ │ ├── Mapping.java │ │ │ │ ├── Param.java │ │ │ │ ├── ParamSource.java │ │ │ │ ├── RequestBody.java │ │ │ │ └── Returning.java │ │ │ ├── deserializer/ │ │ │ │ ├── RequestBodyDeserializer.java │ │ │ │ ├── RequestBodyDeserializerFactory.java │ │ │ │ ├── RequestBodyDeserializerNotFoundException.java │ │ │ │ ├── factory/ │ │ │ │ │ ├── DeserializerFactory.java │ │ │ │ │ └── impl/ │ │ │ │ │ ├── DefaultJsonRequestBodyDeserializerFactory.java │ │ │ │ │ └── DefaultTextPlainRequestBodyDeserializerFactory.java │ │ │ │ └── impl/ │ │ │ │ ├── DefaultJsonRequestBodyDeserializer.java │ │ │ │ └── DefaultTextPlainRequestBodyDeserializer.java │ │ │ ├── filter/ │ │ │ │ ├── DefaultFilterChain.java │ │ │ │ └── FilterChain.java │ │ │ ├── handler/ │ │ │ │ ├── ExceptionHandleResult.java │ │ │ │ ├── ExceptionHandler.java │ │ │ │ ├── HandleContext.java │ │ │ │ ├── Handler.java │ │ │ │ ├── HandlerMappingRegistry.java │ │ │ │ ├── HandlerNotFoundException.java │ │ │ │ ├── HandlerParameter.java │ │ │ │ └── impl/ │ │ │ │ ├── DefaultExceptionHandler.java │ │ │ │ └── DefaultHandlerNotFoundExceptionHandler.java │ │ │ ├── mapping/ │ │ │ │ ├── AmbiguousPathPatternException.java │ │ │ │ ├── DefaultMappingContext.java │ │ │ │ ├── MappingContext.java │ │ │ │ ├── PathMatcher.java │ │ │ │ ├── RegexPathMatcher.java │ │ │ │ ├── RegexUrlPatternMap.java │ │ │ │ └── UrlPatternMap.java │ │ │ ├── pipeline/ │ │ │ │ ├── ContextInitializationInboundHandler.java │ │ │ │ ├── ExceptionHandling.java │ │ │ │ ├── FilterChainInboundHandler.java │ │ │ │ ├── HandleMethodExecutor.java │ │ │ │ ├── HandlerParameterDecoder.java │ │ │ │ ├── HttpRequestDispatcher.java │ │ │ │ └── RestfulServiceChannelInitializer.java │ │ │ ├── serializer/ │ │ │ │ ├── ResponseBodySerializer.java │ │ │ │ ├── ResponseBodySerializerFactory.java │ │ │ │ ├── ResponseBodySerializerNotFoundException.java │ │ │ │ ├── factory/ │ │ │ │ │ ├── SerializerFactory.java │ │ │ │ │ └── impl/ │ │ │ │ │ └── DefaultJsonResponseBodySerializerFactory.java │ │ │ │ └── impl/ │ │ │ │ └── DefaultJsonResponseBodySerializer.java │ │ │ └── wrapper/ │ │ │ └── QueryParameterMap.java │ │ └── resources/ │ │ └── META-INF/ │ │ └── services/ │ │ ├── org.apache.shardingsphere.elasticjob.restful.deserializer.factory.DeserializerFactory │ │ └── org.apache.shardingsphere.elasticjob.restful.serializer.factory.SerializerFactory │ └── test/ │ ├── java/ │ │ └── org/ │ │ └── apache/ │ │ └── shardingsphere/ │ │ └── elasticjob/ │ │ └── restful/ │ │ ├── RegexPathMatcherTest.java │ │ ├── RegexUrlPatternMapTest.java │ │ ├── controller/ │ │ │ ├── IndexController.java │ │ │ ├── JobController.java │ │ │ └── TrailingSlashTestController.java │ │ ├── deserializer/ │ │ │ └── RequestBodyDeserializerFactoryTest.java │ │ ├── filter/ │ │ │ └── DefaultFilterChainTest.java │ │ ├── handler/ │ │ │ └── CustomIllegalStateExceptionHandler.java │ │ ├── pipeline/ │ │ │ ├── FilterChainInboundHandlerTest.java │ │ │ ├── HandlerParameterDecoderTest.java │ │ │ ├── HttpClient.java │ │ │ ├── HttpRequestDispatcherTest.java │ │ │ ├── NettyRestfulServiceTest.java │ │ │ ├── NettyRestfulServiceTrailingSlashInsensitiveTest.java │ │ │ └── NettyRestfulServiceTrailingSlashSensitiveTest.java │ │ ├── pojo/ │ │ │ ├── JobPojo.java │ │ │ └── ResultDto.java │ │ ├── serializer/ │ │ │ ├── CustomTextPlainResponseBodySerializer.java │ │ │ └── ResponseBodySerializerFactoryTest.java │ │ └── wrapper/ │ │ └── QueryParameterMapTest.java │ └── resources/ │ └── META-INF/ │ └── services/ │ └── org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer ├── spring/ │ ├── boot-starter/ │ │ ├── README.md │ │ ├── pom.xml │ │ └── src/ │ │ ├── main/ │ │ │ ├── java/ │ │ │ │ └── org/ │ │ │ │ └── apache/ │ │ │ │ └── shardingsphere/ │ │ │ │ └── elasticjob/ │ │ │ │ └── spring/ │ │ │ │ └── boot/ │ │ │ │ ├── job/ │ │ │ │ │ ├── ElasticJobAutoConfiguration.java │ │ │ │ │ ├── ElasticJobBootstrapConfiguration.java │ │ │ │ │ ├── ElasticJobConfigurationProperties.java │ │ │ │ │ ├── ElasticJobProperties.java │ │ │ │ │ └── ScheduleJobBootstrapStartupRunner.java │ │ │ │ ├── reg/ │ │ │ │ │ ├── ElasticJobRegistryCenterConfiguration.java │ │ │ │ │ ├── ZookeeperProperties.java │ │ │ │ │ └── snapshot/ │ │ │ │ │ ├── ElasticJobSnapshotServiceConfiguration.java │ │ │ │ │ └── SnapshotServiceProperties.java │ │ │ │ └── tracing/ │ │ │ │ ├── ElasticJobTracingConfiguration.java │ │ │ │ └── TracingProperties.java │ │ │ └── resources/ │ │ │ └── META-INF/ │ │ │ ├── additional-spring-configuration-metadata.json │ │ │ ├── spring/ │ │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ │ ├── spring.factories │ │ │ └── spring.provides │ │ └── test/ │ │ ├── java/ │ │ │ └── org/ │ │ │ └── apache/ │ │ │ └── shardingsphere/ │ │ │ └── elasticjob/ │ │ │ └── spring/ │ │ │ └── boot/ │ │ │ ├── job/ │ │ │ │ ├── ElasticJobConfigurationPropertiesTest.java │ │ │ │ ├── ElasticJobSpringBootScannerTest.java │ │ │ │ ├── ElasticJobSpringBootTest.java │ │ │ │ ├── executor/ │ │ │ │ │ ├── CustomClassedJobExecutor.java │ │ │ │ │ ├── PrintJobExecutor.java │ │ │ │ │ └── PrintJobProperties.java │ │ │ │ ├── fixture/ │ │ │ │ │ ├── job/ │ │ │ │ │ │ ├── CustomJob.java │ │ │ │ │ │ └── impl/ │ │ │ │ │ │ ├── AnnotationCustomJob.java │ │ │ │ │ │ └── CustomTestJob.java │ │ │ │ │ └── listener/ │ │ │ │ │ ├── LogElasticJobListener.java │ │ │ │ │ └── NoopElasticJobListener.java │ │ │ │ └── repository/ │ │ │ │ ├── BarRepository.java │ │ │ │ └── impl/ │ │ │ │ └── BarRepositoryImpl.java │ │ │ ├── reg/ │ │ │ │ ├── ZookeeperPropertiesTest.java │ │ │ │ └── snapshot/ │ │ │ │ └── ElasticJobSnapshotServiceConfigurationTest.java │ │ │ └── tracing/ │ │ │ └── TracingConfigurationTest.java │ │ └── resources/ │ │ ├── META-INF/ │ │ │ └── services/ │ │ │ ├── org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor │ │ │ ├── org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor │ │ │ └── org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener │ │ ├── application-elasticjob.yml │ │ ├── application-snapshot.yml │ │ ├── application-tracing.yml │ │ └── logback-test.xml │ ├── core/ │ │ ├── pom.xml │ │ └── src/ │ │ ├── main/ │ │ │ ├── java/ │ │ │ │ └── org/ │ │ │ │ └── apache/ │ │ │ │ └── shardingsphere/ │ │ │ │ └── elasticjob/ │ │ │ │ └── spring/ │ │ │ │ └── core/ │ │ │ │ ├── scanner/ │ │ │ │ │ ├── ClassPathJobScanner.java │ │ │ │ │ ├── ElasticJobScan.java │ │ │ │ │ ├── ElasticJobScanRegistrar.java │ │ │ │ │ └── JobScannerConfiguration.java │ │ │ │ ├── setup/ │ │ │ │ │ └── SpringProxyJobClassNameProvider.java │ │ │ │ └── util/ │ │ │ │ └── AopTargetUtils.java │ │ │ └── resources/ │ │ │ └── META-INF/ │ │ │ └── services/ │ │ │ └── org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProvider │ │ └── test/ │ │ ├── java/ │ │ │ └── org/ │ │ │ └── apache/ │ │ │ └── shardingsphere/ │ │ │ └── elasticjob/ │ │ │ └── spring/ │ │ │ └── core/ │ │ │ ├── setup/ │ │ │ │ └── JobClassNameProviderFactoryTest.java │ │ │ └── util/ │ │ │ ├── AopTargetUtilsTest.java │ │ │ └── TargetJob.java │ │ └── resources/ │ │ └── META-INF/ │ │ └── logback-test.xml │ ├── namespace/ │ │ ├── pom.xml │ │ └── src/ │ │ ├── main/ │ │ │ ├── java/ │ │ │ │ └── org/ │ │ │ │ └── apache/ │ │ │ │ └── shardingsphere/ │ │ │ │ └── elasticjob/ │ │ │ │ └── spring/ │ │ │ │ └── namespace/ │ │ │ │ ├── ElasticJobNamespaceHandler.java │ │ │ │ ├── job/ │ │ │ │ │ ├── parser/ │ │ │ │ │ │ └── JobBeanDefinitionParser.java │ │ │ │ │ └── tag/ │ │ │ │ │ └── JobBeanDefinitionTag.java │ │ │ │ ├── reg/ │ │ │ │ │ ├── parser/ │ │ │ │ │ │ └── ZookeeperBeanDefinitionParser.java │ │ │ │ │ └── tag/ │ │ │ │ │ └── ZookeeperBeanDefinitionTag.java │ │ │ │ ├── scanner/ │ │ │ │ │ ├── parser/ │ │ │ │ │ │ └── JobScannerBeanDefinitionParser.java │ │ │ │ │ └── tag/ │ │ │ │ │ └── JobScannerBeanDefinitionTag.java │ │ │ │ ├── snapshot/ │ │ │ │ │ ├── parser/ │ │ │ │ │ │ └── SnapshotBeanDefinitionParser.java │ │ │ │ │ └── tag/ │ │ │ │ │ └── SnapshotBeanDefinitionTag.java │ │ │ │ └── tracing/ │ │ │ │ ├── parser/ │ │ │ │ │ └── TracingBeanDefinitionParser.java │ │ │ │ └── tag/ │ │ │ │ └── TracingBeanDefinitionTag.java │ │ │ └── resources/ │ │ │ └── META-INF/ │ │ │ ├── namespace/ │ │ │ │ └── elasticjob.xsd │ │ │ ├── spring.handlers │ │ │ └── spring.schemas │ │ └── test/ │ │ ├── java/ │ │ │ └── org/ │ │ │ └── apache/ │ │ │ └── shardingsphere/ │ │ │ └── elasticjob/ │ │ │ └── spring/ │ │ │ └── namespace/ │ │ │ ├── fixture/ │ │ │ │ ├── aspect/ │ │ │ │ │ └── SimpleAspect.java │ │ │ │ ├── job/ │ │ │ │ │ ├── DataflowElasticJob.java │ │ │ │ │ ├── FooSimpleElasticJob.java │ │ │ │ │ ├── annotation/ │ │ │ │ │ │ └── AnnotationSimpleJob.java │ │ │ │ │ └── ref/ │ │ │ │ │ ├── RefFooDataflowElasticJob.java │ │ │ │ │ └── RefFooSimpleElasticJob.java │ │ │ │ ├── listener/ │ │ │ │ │ ├── SimpleCglibListener.java │ │ │ │ │ ├── SimpleJdkDynamicProxyListener.java │ │ │ │ │ ├── SimpleListener.java │ │ │ │ │ └── SimpleOnceListener.java │ │ │ │ └── service/ │ │ │ │ ├── FooService.java │ │ │ │ └── FooServiceImpl.java │ │ │ ├── job/ │ │ │ │ ├── AbstractJobSpringIntegrateTest.java │ │ │ │ ├── AbstractOneOffJobSpringIntegrateTest.java │ │ │ │ ├── JobSpringNamespaceWithEventTraceRdbTest.java │ │ │ │ ├── JobSpringNamespaceWithJobHandlerTest.java │ │ │ │ ├── JobSpringNamespaceWithListenerAndCglibTest.java │ │ │ │ ├── JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java │ │ │ │ ├── JobSpringNamespaceWithListenerTest.java │ │ │ │ ├── JobSpringNamespaceWithRefTest.java │ │ │ │ ├── JobSpringNamespaceWithTypeTest.java │ │ │ │ ├── JobSpringNamespaceWithoutListenerTest.java │ │ │ │ ├── OneOffJobSpringNamespaceWithEventTraceRdbTest.java │ │ │ │ ├── OneOffJobSpringNamespaceWithJobHandlerTest.java │ │ │ │ ├── OneOffJobSpringNamespaceWithListenerAndCglibTest.java │ │ │ │ ├── OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java │ │ │ │ ├── OneOffJobSpringNamespaceWithListenerTest.java │ │ │ │ ├── OneOffJobSpringNamespaceWithRefTest.java │ │ │ │ ├── OneOffJobSpringNamespaceWithTypeTest.java │ │ │ │ └── OneOffJobSpringNamespaceWithoutListenerTest.java │ │ │ ├── scanner/ │ │ │ │ ├── AbstractJobSpringIntegrateTest.java │ │ │ │ └── JobScannerTest.java │ │ │ └── snapshot/ │ │ │ ├── SnapshotSpringNamespaceDisableTest.java │ │ │ ├── SnapshotSpringNamespaceEnableTest.java │ │ │ └── SocketUtils.java │ │ └── resources/ │ │ ├── META-INF/ │ │ │ ├── job/ │ │ │ │ ├── base.xml │ │ │ │ ├── oneOffWithEventTraceRdb.xml │ │ │ │ ├── oneOffWithJobHandler.xml │ │ │ │ ├── oneOffWithJobRef.xml │ │ │ │ ├── oneOffWithJobType.xml │ │ │ │ ├── oneOffWithListener.xml │ │ │ │ ├── oneOffWithListenerAndCglib.xml │ │ │ │ ├── oneOffWithListenerAndJdkDynamicProxy.xml │ │ │ │ ├── oneOffWithoutListener.xml │ │ │ │ ├── withEventTraceRdb.xml │ │ │ │ ├── withJobHandler.xml │ │ │ │ ├── withJobRef.xml │ │ │ │ ├── withJobType.xml │ │ │ │ ├── withListener.xml │ │ │ │ ├── withListenerAndCglib.xml │ │ │ │ ├── withListenerAndJdkDynamicProxy.xml │ │ │ │ └── withoutListener.xml │ │ │ ├── reg/ │ │ │ │ └── regContext.xml │ │ │ ├── scanner/ │ │ │ │ └── jobScannerContext.xml │ │ │ ├── services/ │ │ │ │ └── org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener │ │ │ └── snapshot/ │ │ │ ├── snapshotDisabled.xml │ │ │ └── snapshotEnabled.xml │ │ ├── conf/ │ │ │ ├── job/ │ │ │ │ └── conf.properties │ │ │ └── reg/ │ │ │ └── conf.properties │ │ ├── logback-test.xml │ │ └── script/ │ │ ├── demo.bat │ │ └── demo.sh │ └── pom.xml ├── src/ │ └── resources/ │ ├── checkstyle.xml │ └── spotless/ │ ├── copyright.txt │ └── java.xml └── test/ ├── e2e/ │ ├── pom.xml │ └── src/ │ └── test/ │ ├── java/ │ │ └── org/ │ │ └── apache/ │ │ └── shardingsphere/ │ │ └── elasticjob/ │ │ └── test/ │ │ └── e2e/ │ │ ├── annotation/ │ │ │ ├── BaseAnnotationE2ETest.java │ │ │ ├── OneOffEnabledJobE2ETest.java │ │ │ ├── ScheduleEnabledJobE2ETest.java │ │ │ └── fixture/ │ │ │ ├── AnnotationSimpleJob.java │ │ │ └── AnnotationUnShardingJob.java │ │ ├── raw/ │ │ │ ├── BaseE2ETest.java │ │ │ ├── disable/ │ │ │ │ ├── DisabledJobE2ETest.java │ │ │ │ ├── OneOffDisabledJobE2ETest.java │ │ │ │ └── ScheduleDisabledJobE2ETest.java │ │ │ ├── enable/ │ │ │ │ ├── EnabledJobE2ETest.java │ │ │ │ ├── OneOffEnabledJobE2ETest.java │ │ │ │ └── ScheduleEnabledJobE2ETest.java │ │ │ └── fixture/ │ │ │ ├── executor/ │ │ │ │ └── E2EFixtureJobExecutor.java │ │ │ ├── job/ │ │ │ │ ├── E2EFixtureJob.java │ │ │ │ └── E2EFixtureJobImpl.java │ │ │ └── listener/ │ │ │ ├── DistributeOnceE2EFixtureJobListener.java │ │ │ └── E2EFixtureJobListener.java │ │ └── snapshot/ │ │ ├── BaseSnapshotServiceE2ETest.java │ │ ├── SnapshotServiceDisableE2ETest.java │ │ ├── SnapshotServiceEnableE2ETest.java │ │ └── SocketUtils.java │ └── resources/ │ ├── META-INF/ │ │ └── services/ │ │ ├── org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor │ │ └── org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener │ └── logback-test.xml ├── native/ │ ├── native-image-filter/ │ │ ├── extra-filter.json │ │ └── user-code-filter.json │ ├── pom.xml │ └── src/ │ └── test/ │ ├── java/ │ │ └── org/ │ │ └── apache/ │ │ └── shardingsphere/ │ │ └── elasticjob/ │ │ └── test/ │ │ └── natived/ │ │ ├── TestMain.java │ │ ├── commons/ │ │ │ ├── controller/ │ │ │ │ └── OneOffJobController.java │ │ │ ├── entity/ │ │ │ │ └── Foo.java │ │ │ ├── job/ │ │ │ │ ├── dataflow/ │ │ │ │ │ ├── JavaDataflowJob.java │ │ │ │ │ └── SpringBootDataflowJob.java │ │ │ │ └── simple/ │ │ │ │ ├── JavaSimpleJob.java │ │ │ │ └── SpringBootSimpleJob.java │ │ │ └── repository/ │ │ │ ├── FooRepository.java │ │ │ ├── FooRepositoryFactory.java │ │ │ └── SpringBootFooRepository.java │ │ └── it/ │ │ ├── operation/ │ │ │ └── JavaTest.java │ │ └── staticd/ │ │ ├── JavaTest.java │ │ └── SpringBootDTest.java │ └── resources/ │ ├── application.yml │ └── test-native/ │ └── sh/ │ └── demo.sh ├── pom.xml └── util/ ├── pom.xml └── src/ └── main/ └── java/ └── org/ └── apache/ └── shardingsphere/ └── elasticjob/ └── test/ └── util/ ├── EmbedTestingServer.java └── ReflectionUtils.java ================================================ FILE CONTENTS ================================================ ================================================ FILE: .asf.yaml ================================================ # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # notifications: commits: notifications@shardingsphere.apache.org issues: notifications@shardingsphere.apache.org pullrequests: notifications@shardingsphere.apache.org github: description: Distributed scheduled job labels: - elasticjob - database - scheduled-jobs - cron - job - job-management - shard - quartz - middleware features: issues: true projects: true protected_branches: master: required_status_checks: contexts: - Check - CheckStyle - Check - Spotless - Check - License ================================================ FILE: .github/ISSUE_TEMPLATE/bug-report.md ================================================ --- name: "\U0001F41B Bug Report" about: Something isn't working as expected --- ## Bug Report **For English only**, other languages will not accept. Before report a bug, make sure you have: - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere-elasticjob/issues). - Read documentation: [ElasticJob Doc](https://shardingsphere.apache.org/elasticjob/current/en/overview/). Please pay attention on issues you submitted, because we maybe need more details. If no response anymore and we cannot reproduce it on current information, we will **close it**. Please answer these questions before submitting your issue. Thanks! ### Which version of ElasticJob did you use? ### Expected behavior ### Actual behavior ### Reason analyze (If you can) ### Steps to reproduce the behavior. ### Example codes for reproduce this issue (such as a github link). ================================================ FILE: .github/ISSUE_TEMPLATE/feature-request.md ================================================ --- name: "\U0001F680 Feature Request" about: I have a suggestion --- ## Feature Request **For English only**, other languages will not accept. Please pay attention on issues you submitted, because we maybe need more details. If no response anymore and we cannot make decision by current information, we will **close it**. Please answer these questions before submitting your issue. Thanks! ### Is your feature request related to a problem? ### Describe the feature you would like. ================================================ FILE: .github/ISSUE_TEMPLATE/question.md ================================================ --- name: "\U0001F914 Question" about: Usage question that isn't answered in docs or discussion --- ## Question **For English only**, other languages will not accept. Before asking a question, make sure you have: - Googled your question. - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere-elasticjob/issues). - Read documentation: [ElasticJob Doc](https://shardingsphere.apache.org/elasticjob/current/en/overview/). Please pay attention on issues you submitted, because we maybe need more details. If no response anymore and we cannot reproduce it on current information, we will **close it**. ================================================ FILE: .github/PULL_REQUEST_TEMPLATE ================================================ Fixes #ISSUSE_ID. Changes proposed in this pull request: - - - ================================================ FILE: .github/workflows/graalvm.yml ================================================ # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # name: NativeTest CI - GraalVM Native Image on: pull_request: branches: [ master ] paths: - '.github/workflows/graalvm.yml' - 'reachability-metadata/src/**' - 'test/native/**' jobs: build: if: github.repository == 'apache/shardingsphere-elasticjob' strategy: matrix: java: [ '22.0.2' ] os: [ 'ubuntu-latest' ] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Set up GraalVM CE ${{ matrix.java }} uses: graalvm/setup-graalvm@v1 with: java-version: ${{ matrix.java }} distribution: 'graalvm-community' github-token: ${{ secrets.GITHUB_TOKEN }} cache: 'maven' native-image-job-reports: 'true' - name: Run nativeTest with GraalVM CE for ${{ matrix.java }} run: ./mvnw -PnativeTestInElasticJob -T1C -B -e clean test ================================================ FILE: .github/workflows/maven.yml ================================================ # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # This workflow will build a Java project with Maven # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven name: Java CI with Maven on: pull_request: branches: [ master ] jobs: build: if: github.repository == 'apache/shardingsphere-elasticjob' strategy: matrix: java: [ 8, 17, 21, 24 ] os: [ 'windows-latest', 'macos-latest', 'ubuntu-latest' ] runs-on: ${{ matrix.os }} steps: - name: Configure Git if: matrix.os == 'windows-latest' run: | git config --global core.longpaths true - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: ${{ matrix.java }} cache: 'maven' - name: Build with Maven in Windows if: matrix.os == 'windows-latest' run: | ./mvnw --batch-mode --no-transfer-progress '-Dmaven.javadoc.skip=true' clean install -T1C - name: Build with Maven in Linux or macOS if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' run: | ./mvnw --batch-mode --no-transfer-progress '-Dmaven.javadoc.skip=true' clean install -Pcheck -T1C - name: Upload coverage to Codecov if: matrix.os == 'ubuntu-latest' && matrix.java == '8' uses: codecov/codecov-action@v3 with: file: '**/target/site/jacoco/jacoco.xml' - name: Build Examples with Maven run: ./mvnw clean package -B -f examples/pom.xml -T1C ================================================ FILE: .github/workflows/required-check.yml ================================================ # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # name: Required - Check on: pull_request: branches: [ master ] workflow_dispatch: concurrency: group: check-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: check-checkstyle: name: Check - CheckStyle if: github.repository == 'apache/shardingsphere-elasticjob' runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v3 - name: Run CheckStyle run: ./mvnw checkstyle:check -Pcheck -T1C check-spotless: name: Check - Spotless if: github.repository == 'apache/shardingsphere-elasticjob' runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v3 - name: Run Spotless run: ./mvnw spotless:check -Pcheck -T1C check-license: name: Check - License if: github.repository == 'apache/shardingsphere-elasticjob' runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v3 - name: Run Apache Rat run: ./mvnw apache-rat:check -Pcheck -T1C ================================================ FILE: .gitignore ================================================ # maven ignore target/ *.class *.jar *.war *.zip *.tar *.tar.gz dependency-reduced-pom.xml .flattened-pom.xml pom.xml.versionsBackup # maven plugin ignore release.properties *.gpg # eclipse ignore .settings/ .project .classpath .factorypath # idea ignore .idea/ !/.idea/icon.png !/.idea/vcs.xml *.ipr *.iml *.iws # vscode ignore .vscode/ # temp ignore logs/ *.log *.tlog *.doc *.cache *.diff *.patch *.tmp # system ignore .DS_Store Thumbs.db # antlr ignore gen/ *.tokens # profiler ignore .profiler/ # hugo ignore public/ .hugo_build.lock *.html-e ================================================ FILE: .idea/vcs.xml ================================================ ================================================ FILE: .mvn/jvm.config ================================================ -Xmx1024m -XX:MaxMetaspaceSize=256m ================================================ FILE: .mvn/wrapper/maven-wrapper.properties ================================================ wrapperVersion=3.3.4 distributionType=only-script distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip ================================================ FILE: LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ======================================================================= Apache ShardingSphere Subcomponents: The Apache ShardingSphere project contains subcomponents with separate copyright notices and license terms. Your use of the source code for the these subcomponents is subject to the terms and conditions of the following licenses. ======================================================================== Apache 2.0 licenses ======================================================================== The following components are provided under the Apache License. See project link for details. The text of each license is the standard Apache 2.0 license. Maven Wrapper(mvnw, mvnw.cmd files in root path), https://github.com/apache/maven-wrapper, Apache 2.0 ================================================ FILE: NOTICE ================================================ Apache ShardingSphere Copyright 2018-2026 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). ================================================ FILE: README.md ================================================ # [ElasticJob - Distributed scheduled job](http://shardingsphere.apache.org/elasticjob/) **Official website: https://shardingsphere.apache.org/elasticjob/** [![Stargazers over time](https://starchart.cc/apache/shardingsphere-elasticjob.svg)](https://starchart.cc/apache/shardingsphere-elasticjob) Through the functions of flexible scheduling, resource management and job management, it creates a distributed scheduling solution suitable for Internet scenarios, and provides a diversified job ecosystem through open architecture design. It uses a unified job API for each project. Developers only need code one time and can deploy at will. ElasticJob became an [Apache ShardingSphere](https://shardingsphere.apache.org/) Sub-project on May 28 2020. You are welcome to communicate with the community via the [mailing list](mailto:dev@shardingsphere.apache.org). [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) [![GitHub release](https://img.shields.io/github/release/apache/shardingsphere-elasticjob.svg)](https://github.com/apache/shardingsphere-elasticjob/releases) [![Maven Status](https://maven-badges.herokuapp.com/maven-central/org.apache.shardingsphere.elasticjob/elasticjob/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.shardingsphere.elasticjob/elasticjob) [![Build Status](https://api.travis-ci.com/apache/shardingsphere-elasticjob.svg?branch=master)](https://travis-ci.org/apache/shardingsphere-elasticjob) [![GitHub Workflow](https://img.shields.io/github/actions/workflow/status/apache/shardingsphere-elasticjob/maven.yml?branch=master)](https://github.com/apache/shardingsphere-elasticjob/actions/workflows/maven.yml?query=branch%3Amaster) [![codecov](https://codecov.io/gh/apache/shardingsphere-elasticjob/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/shardingsphere-elasticjob) [![Maintainability](https://cloud.quality-gate.com/dashboard/api/badge?projectName=apache_shardingsphere-elasticjob&branchName=master)](https://cloud.quality-gate.com/dashboard/branches/396041#overview) ## Introduction Using ElasticJob developers can no longer worry about the non functional requirements such as job scale out, so that they can focus more on business coding. At the same time, it can release operators too, so that they do not have to worry about high availability and management, and can automatically operate by simply adding servers. It is a lightweight, decentralized solution that provides distributed task sharding services. ![ElasticJob Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_lite.png) ## Features - Elastic Schedule - Support job sharding and high availability in distributed system - Scale out for throughput and efficiency improvement - Job processing capacity is flexible and scalable with the allocation of resources - Resource Assign - Execute job on suitable time and assigned resources - Aggregation same job to same job executor - Append resources to newly assigned jobs dynamically - Job Governance - Failover - Misfired - Self diagnose and recover when distribute environment unstable - Job Dependency (TODO) - DAG based job dependency - DAG based job item dependency - Job Open Ecosystem - Unify job api for extension - Support rich job type lib, such as dataflow, script, HTTP, file, big data - Focus business SDK, can work with Spring IOC - [Admin Console](https://github.com/apache/shardingsphere-elasticjob-ui) - Job administration - Job event trace query - Registry center management ## Environment Required ### Java Java 8 or above required. ### Maven Maven 3.5.0 or above required. ### ZooKeeper ZooKeeper 3.6.0 or above required. [See details](https://zookeeper.apache.org/) ================================================ FILE: README_ZH.md ================================================ # [ElasticJob - 分布式作业调度解决方案](http://shardingsphere.apache.org/elasticjob/) **官方网站: https://shardingsphere.apache.org/elasticjob/** [![Stargazers over time](https://starchart.cc/apache/shardingsphere-elasticjob.svg)](https://starchart.cc/apache/shardingsphere-elasticjob) ElasticJob 是面向互联网生态和海量任务的分布式调度解决方案。 它通过弹性调度、资源管控、以及作业治理的功能,打造一个适用于互联网场景的分布式调度解决方案,并通过开放的架构设计,提供多元化的作业生态。 它的各个产品使用统一的作业 API,开发者仅需一次开发,即可随意部署。 ElasticJob 已于 2020 年 5 月 28 日成为 [Apache ShardingSphere](https://shardingsphere.apache.org/) 的子项目。 欢迎通过[邮件列表](mailto:dev@shardingsphere.apache.org)参与讨论。 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) [![GitHub release](https://img.shields.io/github/release/apache/shardingsphere-elasticjob.svg)](https://github.com/apache/shardingsphere-elasticjob/releases) [![Maven Status](https://maven-badges.herokuapp.com/maven-central/org.apache.shardingsphere.elasticjob/elasticjob/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.shardingsphere.elasticjob/elasticjob) [![Build Status](https://secure.travis-ci.org/apache/shardingsphere-elasticjob.png?branch=master)](https://travis-ci.org/apache/shardingsphere-elasticjob) [![GitHub Workflow](https://img.shields.io/github/workflow/status/apache/shardingsphere-elasticjob/Java%20CI%20with%20Maven%20on%20macOS/master)](https://github.com/apache/shardingsphere-elasticjob/actions?query=workflow%3A%22Java+CI+with+Maven+on+macOS%22) [![codecov](https://codecov.io/gh/apache/shardingsphere-elasticjob/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/shardingsphere-elasticjob) ## 简介 使用 ElasticJob 能够让开发工程师不再担心任务的线性吞吐量提升等非功能需求,使他们能够更加专注于面向业务编码设计; 同时,它也能够解放运维工程师,使他们不必再担心任务的可用性和相关管理需求,只通过轻松的增加服务节点即可达到自动化运维的目的。 它定位为轻量级无中心化解决方案,使用 jar 的形式提供分布式任务的协调服务。 ![ElasticJob Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_lite.png) ## 功能列表 - 弹性调度 - 支持任务在分布式场景下的分片和高可用 - 能够水平扩展任务的吞吐量和执行效率 - 任务处理能力随资源配备弹性伸缩 - 资源分配 - 在适合的时间将适合的资源分配给任务并使其生效 - 相同任务聚合至相同的执行器统一处理 - 动态调配追加资源至新分配的任务 - 作业治理 - 失效转移 - 错过作业重新执行 - 自诊断修复 - 作业依赖(TODO) - 基于有向无环图(DAG)的作业间依赖 - 基于有向无环图(DAG)的作业分片间依赖 - 作业开放生态 - 可扩展的作业类型统一接口 - 丰富的作业类型库,如数据流、脚本、HTTP、文件、大数据等 - 易于对接业务作业,能够与 Spring 依赖注入无缝整合 - [可视化管控端](https://github.com/apache/shardingsphere-elasticjob-ui) - 作业管控端 - 作业执行历史数据追踪 - 注册中心管理 ## 环境要求 ### Java 请使用 Java 8 及其以上版本。 ### Maven 请使用 Maven 3.5.0 及其以上版本。 ### ZooKeeper 请使用 ZooKeeper 3.6.0 及其以上版本。[详情参见](https://zookeeper.apache.org/) ================================================ FILE: RELEASE-NOTES.md ================================================ ## 3.0.5 ### CVE 1. Fix CVE-2025-25193, CVE-2024-47535 [#2498](https://github.com/apache/shardingsphere-elasticjob/pull/2498) 1. Fix CVE-2024-22259 [#2500](https://github.com/apache/shardingsphere-elasticjob/pull/2500) ### API Changes 1. Kernel: Refactor of the way Lambda job classes are identified - [#2370](https://github.com/apache/shardingsphere-elasticjob/issues/2370) ### New Features 1. Bootstrap: Provides built-in GraalVM Reachability Metadata and nativeTest on Elasticjob Bootstrap - [#2268](https://github.com/apache/shardingsphere-elasticjob/pull/2268) 1. Lifecycle: Support dynamic configuration of jobs through the Operation API in GraalVM Native Image - [#2426](https://github.com/apache/shardingsphere-elasticjob/pull/2426) 1. Registry Center: Allows to skip Ensemble Tracker for ZookeeperConfiguration to allow connecting to HA enabled Zookeeper clusters in Kubernetes - [#2072](https://github.com/apache/shardingsphere-elasticjob/issues/2072) ### Enhancements 1. Build: Support for building with OpenJDK 22 - [#2407](https://github.com/apache/shardingsphere-elasticjob/issues/2407) 1. Spring Boot Starter: Block `elasticjob-spring-boot-starter` from passing `spring-boot-starter` test scope dependencies - [#2418](https://github.com/apache/shardingsphere-elasticjob/issues/2418) 1. Doc: Adds documentation for connecting to Zookeeper Server with SASL enabled - [#2442](https://github.com/apache/shardingsphere-elasticjob/pull/2442) 1. Dependencies: Bump Quartz to 2.4.0 - [#2439](https://github.com/apache/shardingsphere-elasticjob/issues/2439) 1. Build: Support building and using ElasticJob with JDK23 - [#2453](https://github.com/apache/shardingsphere-elasticjob/issues/2453) 1. Build: Support building and using ElasticJob with JDK24 - [#2481](https://github.com/apache/shardingsphere-elasticjob/pull/2481) ### Bug Fixes 1. Build: Removes non-existent `elasticjob-tracing-api` and `elasticjob-error-handler-spi` module - [#2412](https://github.com/apache/shardingsphere-elasticjob/pull/2412) 1. Spring Boot Starter: Fixes the issue that OneOffJobBootstrap cannot be used under ElasticJob Spring Boot Starter - [#2014](https://github.com/apache/shardingsphere-elasticjob/issues/2014) 1. Spring: Fixes potential conflict in AOP proxy job class identification in Spring Framework - [#2012](https://github.com/apache/shardingsphere-elasticjob/issues/2012) ### Change Logs 1. [MILESTONE](https://github.com/apache/shardingsphere-elasticjob/milestone/7) ## 3.0.4 ### Dependencies Upgrade 1. Update dependencies to fix CVE ### Enhancements 1. Support for building with OpenJDK 21 2. Accelerate the startup speed of ElasticJob 3. Migrate from Junit Vintage to Junit Jupiter ### Change Logs 1. [MILESTONE 3.0.4](https://github.com/apache/shardingsphere-elasticjob/milestone/9) ## 3.0.3 ### Bug Fixes 1. Job class conflict error caused by empty String 1. Possible NPE in LegacyCrashedRunningItemListener 1. Possible NPE in InstanceService.getAvailableJobInstances 1. Job listeners configured in local configuration were used even if overwrite=false ### Enhancements 1. Add new job dump method in JobOperateAPI 1. Avoid once listener invoke multi times ### Change Logs 1. [MILESTONE 3.0.3](https://github.com/apache/shardingsphere-elasticjob/milestone/8) ## 3.0.2 ### Bug Fixes 1. Fix itemErrorMessages not cleared after job finished. 1. Fix Curator notify thread may be blocked and avoid probably endless loop in ServerService. 1. NPE occur when job instance could not be unmarshalled. 1. Fix failover too sensitive. ### Enhancements 1. Script Job exception's stack was ignored. 1. Support using different event trace data source when using Spring Boot. 1. Supports building project by Java 19. ### Change Logs 1. [MILESTONE 3.0.2](https://github.com/apache/shardingsphere-elasticjob/milestone/5) ## 3.0.1 ### Enhancements 1. Avoids creating too many threads for JobTracingEventBus 1. Job listeners can be ordered 1. Supports setting timezone for job 1. Some enhancements in Spring Boot Starter 1. Supports configuring preferred ip by regex ### Bug Fixes 1. Lifecycle module: JobOperateAPIImpl#trigger does not work 1. Job conflict may occur when using Spring Boot Starter ### Change Logs 1. [MILESTONE 3.0.1](https://github.com/apache/shardingsphere-elasticjob/milestone/6) ## 3.0.0 ### Enhancements 1. Support configuring Mail SMTP SSL trust in elasticjob-error-handler-email ### Bug Fixes 1. The failover may not work in distributed deployment 2. ReconcileService is still running after the job shutdown ### Dependencies 1. Make the spring-boot-starter-jdbc optional in ElasticJob Spring Boot Starter ### Change Logs 1. [MILESTONE 3.0.0](https://github.com/apache/shardingsphere-elasticjob/milestone/4) ## 3.0.0-RC1 ### API Changes 1. Simplify usage of injecting OneOffJob when using Spring Boot Starter 1. Refactor job tracing configuration to support persistence ### New Features 1. Support reloading JobErrorHandler and ExecutorService when configuration changed 1. Add authentication support in Cloud Scheduler ### Bug Fixes 1. Fix TracingConfiguration doesn't work when the property overwrite is false 1. Fix SnapshotService may be unavailable in specific situation 1. Fix some minor problems in Restful module ### Build & Dependencies 1. Upgrade commons-dbcp to commons-dbcp2 in Cloud Scheduler ### Change Logs 1. [MILESTONE 3.0.0-RC1](https://github.com/apache/shardingsphere-elasticjob/milestone/3) ## 3.0.0-beta ### API Changes 1. Refactor job listener configuration 1. Refactor job error handler configuration 1. Refactor job tracing configuration ### New Features 1. Support HTTP job 1. Remove spring boot dependencies from job kernel module 1. Support email notification when job execute error 1. Support wechat notification when job execute error 1. Support dingtalk notification when job execute error ### Bug Fixes 1. Fix bug of one-off job cannot work with sharding 1. Fix bug of table and index name case-insensitive for event trace using database 1. Fix bug of dead lock when resharding flag set incorrectly ### Change Logs 1. [MILESTONE](https://github.com/apache/shardingsphere-elasticjob/milestone/2) ## 3.0.0-alpha ### Build & Dependencies 1. Upgrade the minimum supported version of JDK to Java8 1. Update Zookeeper to version 3.6.x and curator to version 5.1.0 1. Update Google Guava to version 29.0-jre ### API Changes 1. Change maven groupId to org.apache.shardingsphere.elasticjob 1. Change package name to org.apache.shardingsphere.elasticjob 1. Change spring namespace name to http://shardingsphere.apache.org/schema/elasticjob 1. New job API, use SPI to customize job type 1. Use SPI to introduce configuration strategies 1. Split console and UI from job core modules ### New Features 1. Add One-off job executor 1. Add Spring Boot Starter for ElasticJob-Lite 1. Add more databases support for event trace persist 1. User indicate IP address via system environment supported ### Bug Fixes 1. Fix bug for executor thread ContextClassLoader is empty with ElasticJob-Cloud 1. Fix bug for enable job from web console have no effect 1. Shutdown job when application exit 1. Fix NPE when failover out-of-order in Curator asynchronized persist 1. Get correct job class name when using CGLIB proxy ### Change Logs 1. [MILESTONE](https://github.com/apache/shardingsphere-elasticjob/milestone/1) ## 2.1.5 ### New Features 1. [ISSUE #373](https://github.com/elasticjob/elastic-job/issues/373) Cloud can distinguish processing TASK_UNREACHABLE,TASK_UNKNOWN,TASK_DROPPED,TASK_GONE,etc ### Bug Fixes 1. [ISSUE #367](https://github.com/elasticjob/elastic-job/issues/367) Massive stacked jobs performed after Cloud restart because disabled job does not stop Ready queue 1. [ISSUE #382](https://github.com/elasticjob/elastic-job/issues/382) UI verification error, maximum number of shards should not be verified 1. [ISSUE #383](https://github.com/elasticjob/elastic-job/issues/383) UI verification error, minimum number of listening port should not be verified ## 2.1.4 ### Enhancement 1. [ISSUE #29](https://github.com/elasticjob/elastic-job/issues/29) Console support english 1. [ISSUE #352](https://github.com/elasticjob/elastic-job/issues/352) Running elastic-job-cloud-executor locally without mesos environment ### Bug Fixes 1. [ISSUE #322](https://github.com/elasticjob/elastic-job/issues/322) Schedule tasks to evaluate resources when considering the use of resources for executor in elastic-job-cloud-scheduler module 1. [ISSUE #341](https://github.com/elasticjob/elastic-job/issues/341) Script task configuration in elastic-job-cloud-console is missing execution script 1. [ISSUE #343](https://github.com/elasticjob/elastic-job/issues/343) Script task execution script is incorrect in elastic-job-cloud-console module 1. [ISSUE #345](https://github.com/elasticjob/elastic-job/issues/345) The status is not displayed correctly when the task is all disabled in elastic-job-lite-console module 1. [ISSUE #351](https://github.com/elasticjob/elastic-job/issues/351) Manage background add registry, login credentials bar can not enter ':' in elastic-job-lite-console module ## 2.1.3 ### Enhancement 1. [ISSUE #327](https://github.com/elasticjob/elastic-job/issues/327) spring namespace supports use xml to config beans 1. [ISSUE #336](https://github.com/elasticjob/elastic-job/issues/336) Cloud task submission failure returns error details to framework ### Bug Fixes 1. [ISSUE #321](https://github.com/elasticjob/elastic-job/issues/321) elastic-job-lite The namespace is not support / when UI adds the registry 1. [ISSUE #333](https://github.com/elasticjob/elastic-job/issues/333) elastic-job-lite Registration center configuration login credentials in the UI implicit display 1. [ISSUE #334](https://github.com/elasticjob/elastic-job/issues/334) elastic-job-lite UI can't find conf\auth.properties file on windows platform 1. [ISSUE #335](https://github.com/elasticjob/elastic-job/issues/335) elastic-job-lite UI guest account configuration does not work in conf\auth.properties file ## 2.1.2 ### New Features 1. [ISSUE #301](https://github.com/elasticjob/elastic-job/issues/301) Console add guest permission configuration, guest only allows viewing, not allowed to change 1. [ISSUE #312](https://github.com/elasticjob/elastic-job/issues/312) Cloud support self-healing ### Enhancement 1. [ISSUE #293](https://github.com/elasticjob/elastic-job/issues/293) Lite Console datasource configuration adds connection testing capabilities 1. [ISSUE #296](https://github.com/elasticjob/elastic-job/issues/296) Cloud operational UI refactoring, consistent with lite style 1. [ISSUE #302](https://github.com/elasticjob/elastic-job/issues/302) Failure transfer and task run state monitoring separation 1. [ISSUE #304](https://github.com/elasticjob/elastic-job/issues/304) Cloud add associated features with Mesos roles 1. [ISSUE #316](https://github.com/elasticjob/elastic-job/issues/316) Lite running task association process ID ### Bug Fixes 1. [ISSUE #291](https://github.com/elasticjob/elastic-job/issues/291) elastic-job console failure reason display is not complete 1. [ISSUE #306](https://github.com/elasticjob/elastic-job/issues/306) Switch whether to monitor job execution status and task intervals are short may occur when the task cannot continue to run 1. [ISSUE #310](https://github.com/elasticjob/elastic-job/issues/310) Create to many sequential nodes after configuration check time error seconds for this machine and registry ## 2.1.1 ### New Features 1. [ISSUE #242](https://github.com/elasticjob/elastic-job/issues/242) Elastic-Job-Cloud supports delete application and task 1. [ISSUE #243](https://github.com/elasticjob/elastic-job/issues/243) Elastic-Job-Cloud supports enable/disable application and task ### Enhancement 1. [ISSUE #268](https://github.com/elasticjob/elastic-job/issues/268) Simplify POM dependency ### Bug Fixes 1. [ISSUE #266](https://github.com/elasticjob/elastic-job/issues/266) Elastic-Job-Lite start script specifies that the port is invalid 1. [ISSUE #269](https://github.com/elasticjob/elastic-job/issues/269) EventTrace failure record is not affected by sample rate and the time of failure is recorded 1. [ISSUE #270](https://github.com/elasticjob/elastic-job/issues/270) Console send two requests after clicks the button 1. [ISSUE #272](https://github.com/elasticjob/elastic-job/issues/272) Elastic-Job-Lite UI job dimensions that should appear as disabled only if all servers are disabled 1. [ISSUE #275](https://github.com/elasticjob/elastic-job/issues/275) After stopping Zookeeper, restart Zookeeper and the task does not continue 1. [ISSUE #276](https://github.com/elasticjob/elastic-job/issues/276) When fail transfer is turned on and the shard task is performed, the task is repeated 1. [ISSUE #279](https://github.com/elasticjob/elastic-job/issues/279) Add event tracking data source, database connection address can not have parameters 1. [ISSUE #280](https://github.com/elasticjob/elastic-job/issues/280) The historical status of the task history page is not displayed correctly 1. [ISSUE #283](https://github.com/elasticjob/elastic-job/issues/283) Task is not set overwrite and local configuration is inconsistent with the registration center, the cron started by the task shall be based on the registry 1. [ISSUE #290](https://github.com/elasticjob/elastic-job/issues/290) Elastic-Job-Cloud when deleting a disabled APP or JOB, the corresponding disabled node data cannot be deleted ## 2.1.0 ### New Features 1. [ISSUE #195](https://github.com/elasticjob/elastic-job/issues/195) Elastic-Job-Lite self-diagnose and fix problems caused by distributed instability 1. [ISSUE #248](https://github.com/elasticjob/elastic-job/issues/248) Elastic-Job-Lite the same job server can run multiple JVM instances with the same job name(Cloud Native) 1. [ISSUE #249](https://github.com/elasticjob/elastic-job/issues/249) Elastic-Job-Lite Operations UI supports incident tracking queries ### Enhancement 1. [ISSUE #240](https://github.com/elasticjob/elastic-job/issues/240) Elastic-Job-Lite operational UI refactoring. 1. [ISSUE #262](https://github.com/elasticjob/elastic-job/issues/262) Elastic-Job-Lite console delete job configuration. ### Bug Fixes 1. [ISSUE #237](https://github.com/elasticjob/elastic-job/issues/238) Add the REST API check on the total number of shards not less than 1 1. [ISSUE #238](https://github.com/elasticjob/elastic-job/issues/238) IP regular expression error 1. [ISSUE #246](https://github.com/elasticjob/elastic-job/issues/246) After using JobOperateAPI.remove(),JobScheduler.init() triggers execution multiple times after creating the same job 1. [ISSUE #250](https://github.com/elasticjob/elastic-job/issues/250) Misfire task triggers more than once ### Refactor 1. [ISSUE #263](https://github.com/elasticjob/elastic-job/issues/263) Elastic-Job-Lite Job OperationAPI Re-grooming 1. [ISSUE #264](https://github.com/elasticjob/elastic-job/issues/264) Elastic-Job-Lite Data storage restructuring, but forward compatibility ## 2.0.5 ### New Features 1. [ISSUE #191](https://github.com/elasticjob/elastic-job/issues/191) Framework's HA feature 1. [ISSUE #217](https://github.com/elasticjob/elastic-job/issues/217) cloud add APP dimension configuration 1. [ISSUE #223](https://github.com/elasticjob/elastic-job/issues/223) cloud resident job event tracking sample rate ### Bug Fixes 1. [ISSUE 222](https://github.com/elasticjob/elastic-job/issues/222) elastic-job-lite-spring reg configuration parameter max-retries does not work 1. [ISSUE 231](https://github.com/elasticjob/elastic-job/issues/231) When a cloud job is deleted in bulk, mesos synchronizes TASK_LOST message to the framework in advance, causing the job to be re-arranged in the ready queue and executed ## 2.0.4 ### New Features 1. [ISSUE #203](https://github.com/elasticjob/elastic-job/issues/203) Cloud task add run statistics and provide REST API queries 1. [ISSUE #215](https://github.com/elasticjob/elastic-job/issues/215) cloud operations management UI ### Enhancement 1. [ISSUE #187](https://github.com/elasticjob/elastic-job/issues/187) ShardingContext add task attribute to business side ### Bug Fixes 1. [ISSUE #189](https://github.com/elasticjob/elastic-job/issues/189) Manage background to perform a failure operation, but the task is still being executed 1. [ISSUE #204](https://github.com/elasticjob/elastic-job/issues/204) Async execution of messages in consistency results in inaccurate database data 1. [ISSUE #209](https://github.com/elasticjob/elastic-job/issues/209) cloud task resource allocation algorithm improvement ## 2.0.3 ### Refactor 1. [ISSUE #184](https://github.com/elasticjob/elastic-job/issues/184) ExecutorServiceHandler interface method adjustment, add jobName used to distinguish between different job thread names 1. [ISSUE #186](https://github.com/elasticjob/elastic-job/issues/186) Simplify SpringJobScheduler use by removing Spring Namespace DTO-related code ### New Features 1. [ISSUE #178](https://github.com/elasticjob/elastic-job/issues/178) Event-driven trigger jobs ### Enhancement 1. [ISSUE #179](https://github.com/elasticjob/elastic-job/issues/179) Transient's Script-type task optimization, no Java Executor support required 1. [ISSUE #182](https://github.com/elasticjob/elastic-job/issues/182) add support for spring boot ### Bug Fixes 1. [ISSUE #177](https://github.com/elasticjob/elastic-job/issues/177) Spring Namespace Job: Script Null Pointer in version 2.0.2 1. [ISSUE #185](https://github.com/elasticjob/elastic-job/issues/185) Executor over-occupancy of sharding resources leads to waste of resources ## 2.0.2 ### Refactor 1. [ISSUE #153](https://github.com/elasticjob/elastic-job/issues/153) Centralization of event tracking configuration 1. [ISSUE #160](https://github.com/elasticjob/elastic-job/issues/160) Adjust the maven module structure to provide elastic-job-common and its secondary modules, the original elastic-job-core module migration to elastic-job-common-core ### Enhancement 1. [ISSUE #159](https://github.com/elasticjob/elastic-job/issues/159) Available in any version from Spring 3.1.0.RELEASE to Spring 4 1. [ISSUE #164](https://github.com/elasticjob/elastic-job/issues/164) JobBeans that have been declared in the job Spring namespace no longer need to declare @Component or define in Spring xml ### Bug Fixes 1. [ISSUE #64](https://github.com/elasticjob/elastic-job/issues/64) Spring namespace, if you register multiple job beans of the same class, will cause job beans to look up inaccurately 1. [ISSUE #115](https://github.com/elasticjob/elastic-job/issues/115) Console add new registry, no connection success, back stage has been repeatedly connected and reported errors 1. [ISSUE #151](https://github.com/elasticjob/elastic-job/issues/151) Lack of support for relational database-based event tracking for databases outside MySQL 1. [ISSUE #152](https://github.com/elasticjob/elastic-job/issues/152) Job custom exception processor is invalid and is always handled by Default JobExceptionHandler 1. [ISSUE #156](https://github.com/elasticjob/elastic-job/issues/156) Job event tracking overall call link data acquisition 1. [ISSUE #158](https://github.com/elasticjob/elastic-job/issues/158) Job misses sharding when it is paused and will no longer shard 1. [ISSUE #161](https://github.com/elasticjob/elastic-job/issues/161) Version of Lite deployed to some versions of Tomcat cannot be started 1. [ISSUE #163](https://github.com/elasticjob/elastic-job/issues/163) The project is started or the task is automatically performed after the task is set to disable true 1. [ISSUE #165](https://github.com/elasticjob/elastic-job/issues/165) Shard thread deadlock when all service nodes are disable 1. [ISSUE #167](https://github.com/elasticjob/elastic-job/issues/167) Failover job adds task ID record ## 2.0.1 ### Bug Fixes 1. [ISSUE #141](https://github.com/elasticjob/elastic-job/issues/141) Remove the reg module to read information from zk, making the reg namespace's placeholder fully available 1. [ISSUE #143](https://github.com/elasticjob/elastic-job/issues/143) elastic-job-cloud-scheduler memory leak 1. [ISSUE #145](https://github.com/elasticjob/elastic-job/issues/145) After modifying the database connection of the task log, the log is still written to the old database 1. [ISSUE #146](https://github.com/elasticjob/elastic-job/issues/146) Thread pool reuse problem for a task 1. [ISSUE #147](https://github.com/elasticjob/elastic-job/issues/147) console task does not load, background there is an null pointer exception 1. [ISSUE #149](https://github.com/elasticjob/elastic-job/issues/149) Operations platform delete tasks, occasionally encounter deletion incomplete situation 1. [ISSUE #150](https://github.com/elasticjob/elastic-job/issues/150) Cloud's misfire feature will be performed as jobs pile up ## 2.0.0 ### New Features 1. Elastic-Job-Cloud initial version 1. Reconstruct the original Elastic-Job to Elastic-Job-Lite ### Bug Fixes 1. [ISSUE #119](https://github.com/elasticjob/elastic-job/issues/119) Quartz does not close properly when spring container is closed 1. [ISSUE #123](https://github.com/elasticjob/elastic-job/issues/123) Stand-alone running timing task, zk disconnect after reconnecting, did not trigger the leader election 1. [ISSUE #127](https://github.com/elasticjob/elastic-job/issues/127) Spring configuration task id cannot use placeholders ## 1.1.1 ### Refactor 1. [ISSUE #116](https://github.com/elasticjob/elastic-job/issues/116) HandleJobExecutionException parameter changes for job interface ### Enhancement 1. [ISSUE #110](https://github.com/elasticjob/elastic-job/issues/110) Trigger the task manually ### Bug Fixes 1. [ISSUE #99](https://github.com/elasticjob/elastic-job/issues/99) After deleting a task asynchronously caused the job to be deleted, the task that has not yet ended continues to create zk data ## 1.1.0 ### Refactor 1. [ISSUE #97](https://github.com/elasticjob/elastic-job/issues/97) JobConfiguration Refactored to SimpleJobConfiguration,DataflowJobConfiguration,ScriptJobConfiguration 1. [ISSUE #102](https://github.com/elasticjob/elastic-job/issues/102) Redefine Java/Spring Config API,replace Constructor+Setter with Factory+Builder model 1. [ISSUE #104](https://github.com/elasticjob/elastic-job/issues/104) Remove @Deprecated code 1. [ISSUE #105](https://github.com/elasticjob/elastic-job/issues/105) Reconstructing the Spring Namespace Hump Definition 1. [ISSUE #106](https://github.com/elasticjob/elastic-job/issues/106) isStreaming Configuration 1. [ISSUE #107](https://github.com/elasticjob/elastic-job/issues/107) reg-center renamed registry-center-ref ## 1.0.8 ### New Features 1. [ISSUE #95](https://github.com/elasticjob/elastic-job/issues/95) Add script type job support ## 1.0.7 ### Refactor 1. [ISSUE #88](https://github.com/elasticjob/elastic-job/issues/88) Stop task renamed pause ### New Features 1. [ISSUE #91](https://github.com/elasticjob/elastic-job/issues/91) Job Lifecycle Action API ### Enhancement 1. [ISSUE #84](https://github.com/elasticjob/elastic-job/issues/84) The console provides job enable/disable button action 1. [ISSUE #87](https://github.com/elasticjob/elastic-job/issues/87) Adjusting the master node election process, job shutdown, disabling and pausing will trigger the master node election 1. [ISSUE #93](https://github.com/elasticjob/elastic-job/issues/93) The registry configuration provides default values for baseSleepTimeMilliseconds, maxSleepTimeMilliseconds, and maxRetries ### Bug Fixes 1. [ISSUE #92](https://github.com/elasticjob/elastic-job/issues/92) Modifying the total shard parameter results in a listening throw timeout exception performed by only a single node ## 1.0.6 ### Enhancement 1. [ISSUE #71](https://github.com/elasticjob/elastic-job/issues/71) Task off function(shutdown) 1. [ISSUE #72](https://github.com/elasticjob/elastic-job/issues/72) Closed jobs can be deleted 1. [ISSUE #81](https://github.com/elasticjob/elastic-job/issues/81) Using the last end state of a centralized cleanup job instead of the respective cleanup, each cleaning may result in an uncleaned end state due to offline ### Bug Fixes 1. [ISSUE #74](https://github.com/elasticjob/elastic-job/issues/74) When streaming and fail transfer, the failover shard item cannot be executed once and stopped 1. [ISSUE #77](https://github.com/elasticjob/elastic-job/issues/77) Dataflow type task, fetchData if there is data, should be executed in pairs with processData 1. [ISSUE #78](https://github.com/elasticjob/elastic-job/issues/78) Spring configuration job monitoring enable AOP causes problems that do not work properly ## 1.0.5 ### Refactor 1. [ISSUE #59](https://github.com/elasticjob/elastic-job/issues/59) elastic-job upgrade curator from 2.8.0 to 2.10.0 ### Enhancement 1. [ISSUE #2](https://github.com/elasticjob/elastic-job/issues/2) Add front and post tasks 1. [ISSUE #60](https://github.com/elasticjob/elastic-job/issues/60) Dataflow type task customized thread pool configuration 1. [ISSUE #62](https://github.com/elasticjob/elastic-job/issues/61) Job status cleanup speed-up 1. [ISSUE #65](https://github.com/elasticjob/elastic-job/issues/65) Add spring namespace support for front and post tasks ### Bug Fixes 1. [ISSUE #61](https://github.com/elasticjob/elastic-job/issues/61) Deadlock problem solved when sharding and primary node elections occur at the same time 1. [ISSUE #63](https://github.com/elasticjob/elastic-job/issues/63) You may get TreeCache for other jobs with the same prefix when you get the job TreeCache 1. [ISSUE #69](https://github.com/elasticjob/elastic-job/issues/69) If the job server sharding node in Zk does not exist when sharding, it will not be able to reshard ## 1.0.4 ### Refactor 1. [ISSUE #57](https://github.com/elasticjob/elastic-job/issues/57) Thin module, remove elastic-job-test module 1. [ISSUE #58](https://github.com/elasticjob/elastic-job/issues/58) Add changes in job type interfaces due to bulk processing capabilities ### Enhancement 1. [ISSUE #16](https://github.com/elasticjob/elastic-job/issues/16) Provides embedded zookeeper to simplify the development environment 1. [ISSUE #28](https://github.com/elasticjob/elastic-job/issues/28) Dataflow type tasks to increase processData bulk processing of data 1. [ISSUE #56](https://github.com/elasticjob/elastic-job/issues/56) Job custom parameter settings ## 1.0.3 ### Enhancement 1. [ISSUE #39](https://github.com/elasticjob/elastic-job/issues/39) Add job assisted listening and fetch job runtime information with dump command 1. [ISSUE #43](https://github.com/elasticjob/elastic-job/issues/43) Add job exception handling callback interface ### Bug Fixes 1. [ISSUE #30](https://github.com/elasticjob/elastic-job/issues/30) Registry is down for a long time and resumes, and the job cannot continue 1. [ISSUE #36](https://github.com/elasticjob/elastic-job/issues/36) Task cannot resume after console pause 1. [ISSUE #40](https://github.com/elasticjob/elastic-job/issues/40) TreeCache uses Coarse granularity cause memory overflow ## 1.0.2 ### Refactor 1. [ISSUE #17](https://github.com/elasticjob/elastic-job/issues/17) Task type interface changes ### Enhancement 1. [ISSUE #6](https://github.com/elasticjob/elastic-job/issues/6) Proofreading job server and registry time error 1. [ISSUE #8](https://github.com/elasticjob/elastic-job/issues/8) Increase misfire switch, default enable missed task re-execution 1. [ISSUE #9](https://github.com/elasticjob/elastic-job/issues/9) Sharding policy configurability 1. [ISSUE #10](https://github.com/elasticjob/elastic-job/issues/10) Provides a sorting strategy for odd even shards based on job name hash value 1. [ISSUE #14](https://github.com/elasticjob/elastic-job/issues/14) When the console modifies the cron expression, the task updates the cron in real time 1. [ISSUE #20](https://github.com/elasticjob/elastic-job/issues/20) Operations UI task list shows increased cron expression 1. [ISSUE #54](https://github.com/elasticjob/elastic-job/issues/54) Sequenceperpetual task performance improved, changing fetch data to multithreaded, previously processing data only as multithreaded 1. [ISSUE #55](https://github.com/elasticjob/elastic-job/issues/55) offset storage capabilities ### Bug Fixes 1. [ISSUE #1](https://github.com/elasticjob/elastic-job/issues/1) Inaccurate access to IP addresses in complex network environments 1. [ISSUE #13](https://github.com/elasticjob/elastic-job/issues/13) After a job throws a run-time exception, it does not continue to be triggered later 1. [ISSUE #53](https://github.com/elasticjob/elastic-job/issues/53) Dataflow's Sequence type tasks use multithreaded fetch data ## 1.0.1 1. Initial version ================================================ FILE: api/pom.xml ================================================ 4.0.0 org.apache.shardingsphere.elasticjob elasticjob 3.0.6-SNAPSHOT elasticjob-api ${project.artifactId} org.apache.shardingsphere shardingsphere-infra-spi ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.annotation; import org.apache.shardingsphere.elasticjob.api.JobExtraConfigurationFactory; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * The annotation that specify a job of elastic. */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface ElasticJobConfiguration { /** * Job name. * * @return job name */ String jobName(); /** * CRON expression, control the job trigger time. * * @return cron */ String cron() default ""; /** * Time zone of CRON. * * @return time zone */ String timeZone() default ""; /** * Registry center name. * * @return registry center */ String registryCenter() default ""; /** * Sharding total count. * * @return sharding total count */ int shardingTotalCount(); /** * Sharding item parameters. * * @return sharding item parameters */ String shardingItemParameters() default ""; /** * Job parameter. * * @return job parameter */ String jobParameter() default ""; /** * Monitor job execution status. * * @return monitor execution */ boolean monitorExecution() default true; /** * Enable or disable job failover. * * @return failover */ boolean failover() default false; /** * Enable or disable the missed task to re-execute. * * @return misfire */ boolean misfire() default true; /** * The maximum value for time difference between server and registry center in seconds. * * @return max time diff seconds */ int maxTimeDiffSeconds() default -1; /** * Service scheduling interval in minutes for repairing job server inconsistent state. * * @return reconcile interval minutes */ int reconcileIntervalMinutes() default 10; /** * Job sharding strategy type. * * @return job sharding strategy type */ String jobShardingStrategyType() default ""; /** * Job executor thread pool size provider type. * * @return job executor thread pool size provider type */ String jobExecutorThreadPoolSizeProviderType() default ""; /** * Job thread pool handler type. * * @return job error handler type */ String jobErrorHandlerType() default ""; /** * Job listener types. * * @return job listener types */ String[] jobListenerTypes() default {}; /** * Extra configurations. * * @return extra configurations */ Class[] extraConfigurations() default {}; /** * Job description. * * @return description */ String description() default ""; /** * Job properties. * * @return properties */ ElasticJobProp[] props() default {}; /** * Enable or disable start the job. * * @return disabled */ boolean disabled() default false; /** * Enable or disable local configuration override registry center configuration. * * @return overwrite */ boolean overwrite() default false; } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobProp.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.annotation; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * The annotation that specify elastic-job prop. */ @Documented @Retention(RetentionPolicy.RUNTIME) public @interface ElasticJobProp { /** * Prop key. * * @return key */ String key(); /** * Prop value. * * @return value */ String value() default ""; } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/api/ElasticJob.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.api; /** * ElasticJob interface. */ public interface ElasticJob { } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.api; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.RequiredArgsConstructor; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.LinkedList; import java.util.Properties; /** * ElasticJob configuration. */ @Getter @AllArgsConstructor(access = AccessLevel.PRIVATE) public final class JobConfiguration { private final String jobName; private final String cron; private final String timeZone; private final int shardingTotalCount; private final String shardingItemParameters; private final String jobParameter; private final boolean monitorExecution; private final boolean failover; private final boolean misfire; private final int maxTimeDiffSeconds; private final int reconcileIntervalMinutes; private final String jobShardingStrategyType; private final String jobExecutorThreadPoolSizeProviderType; private final String jobErrorHandlerType; private final Collection jobListenerTypes; private final Collection extraConfigurations; private final String description; private final Properties props; private final boolean disabled; private final boolean overwrite; private final String label; private final boolean staticSharding; /** * Create ElasticJob configuration builder. * * @param jobName job name * @param shardingTotalCount sharding total count * @return ElasticJob configuration builder */ public static Builder newBuilder(final String jobName, final int shardingTotalCount) { return new Builder(jobName, shardingTotalCount); } @RequiredArgsConstructor(access = AccessLevel.PRIVATE) public static class Builder { private final String jobName; private String cron; private String timeZone; private final int shardingTotalCount; private String shardingItemParameters = ""; private String jobParameter = ""; private boolean monitorExecution = true; private boolean failover; private boolean misfire = true; private int maxTimeDiffSeconds = -1; private int reconcileIntervalMinutes = 10; private String jobShardingStrategyType; private String jobExecutorThreadPoolSizeProviderType; private String jobErrorHandlerType; private final Collection jobListenerTypes = new ArrayList<>(); private final Collection extraConfigurations = new LinkedList<>(); private String description = ""; private final Properties props = new Properties(); private boolean disabled; private boolean overwrite; private String label; private boolean staticSharding; /** * Cron expression. * * @param cron cron expression * @return job configuration builder */ public Builder cron(final String cron) { if (null != cron) { this.cron = cron; } return this; } /** * time zone. * * @param timeZone the time zone * @return job configuration builder */ public Builder timeZone(final String timeZone) { if (null != timeZone) { this.timeZone = timeZone; } return this; } /** * Set mapper of sharding items and sharding parameters. * *

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

* * @param shardingItemParameters mapper of sharding items and sharding parameters * @return job configuration builder */ public Builder shardingItemParameters(final String shardingItemParameters) { if (null != shardingItemParameters) { this.shardingItemParameters = shardingItemParameters; } return this; } /** * Set job parameter. * * @param jobParameter job parameter * * @return job configuration builder */ public Builder jobParameter(final String jobParameter) { if (null != jobParameter) { this.jobParameter = jobParameter; } return this; } /** * Set enable or disable monitor execution. * *

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

* * @param monitorExecution monitor job execution status * @return ElasticJob configuration builder */ public Builder monitorExecution(final boolean monitorExecution) { this.monitorExecution = monitorExecution; return this; } /** * Set enable failover. * *

* Only for `monitorExecution` enabled. *

* * @param failover enable or disable failover * @return job configuration builder */ public Builder failover(final boolean failover) { this.failover = failover; return this; } /** * Set enable misfire. * * @param misfire enable or disable misfire * @return job configuration builder */ public Builder misfire(final boolean misfire) { this.misfire = misfire; return this; } /** * Set max tolerate time different seconds between job server and registry center. * *

* ElasticJob will throw exception if exceed max tolerate time different seconds. * -1 means do not check. *

* * @param maxTimeDiffSeconds max tolerate time different seconds between job server and registry center * @return ElasticJob configuration builder */ public Builder maxTimeDiffSeconds(final int maxTimeDiffSeconds) { this.maxTimeDiffSeconds = maxTimeDiffSeconds; return this; } /** * Set reconcile interval minutes for job sharding status. * *

* Monitor the status of the job server at regular intervals, and resharding if incorrect. *

* * @param reconcileIntervalMinutes reconcile interval minutes for job sharding status * @return ElasticJob configuration builder */ public Builder reconcileIntervalMinutes(final int reconcileIntervalMinutes) { this.reconcileIntervalMinutes = reconcileIntervalMinutes; return this; } /** * Set job sharding strategy type. * *

* Default for {@code AverageAllocationJobShardingStrategy}. *

* * @param jobShardingStrategyType job sharding strategy type * @return ElasticJob configuration builder */ public Builder jobShardingStrategyType(final String jobShardingStrategyType) { if (null != jobShardingStrategyType) { this.jobShardingStrategyType = jobShardingStrategyType; } return this; } /** * Set job executor thread pool size provider type. * * @param jobExecutorThreadPoolSizeProviderType job executor thread pool size provider type * @return job configuration builder */ public Builder jobExecutorThreadPoolSizeProviderType(final String jobExecutorThreadPoolSizeProviderType) { this.jobExecutorThreadPoolSizeProviderType = jobExecutorThreadPoolSizeProviderType; return this; } /** * Set job error handler type. * * @param jobErrorHandlerType job error handler type * @return job configuration builder */ public Builder jobErrorHandlerType(final String jobErrorHandlerType) { this.jobErrorHandlerType = jobErrorHandlerType; return this; } /** * Set job listener types. * * @param jobListenerTypes job listener types * @return ElasticJob configuration builder */ public Builder jobListenerTypes(final String... jobListenerTypes) { this.jobListenerTypes.addAll(Arrays.asList(jobListenerTypes)); return this; } /** * Add extra configurations. * * @param extraConfig job extra configuration * @return job configuration builder */ public Builder addExtraConfigurations(final JobExtraConfiguration extraConfig) { extraConfigurations.add(extraConfig); return this; } /** * Set job description. * * @param description job description * @return job configuration builder */ public Builder description(final String description) { if (null != description) { this.description = description; } return this; } /** * Set property. * * @param key property key * @param value property value * @return job configuration builder */ public Builder setProperty(final String key, final String value) { props.setProperty(key, value); return this; } /** * Set whether disable job when start. * *

* Using in job deploy, start job together after deploy. *

* * @param disabled whether disable job when start * @return ElasticJob configuration builder */ public Builder disabled(final boolean disabled) { this.disabled = disabled; return this; } /** * Set whether overwrite local configuration to registry center when job startup. * *

* If overwrite enabled, every startup will use local configuration. *

* * @param overwrite whether overwrite local configuration to registry center when job startup * @return ElasticJob configuration builder */ public Builder overwrite(final boolean overwrite) { this.overwrite = overwrite; return this; } /** * Set label. * * @param label label * @return ElasticJob configuration builder */ public Builder label(final String label) { this.label = label; return this; } /** * Set static sharding. * * @param staticSharding static sharding * @return ElasticJob configuration builder */ public Builder staticSharding(final boolean staticSharding) { this.staticSharding = staticSharding; return this; } /** * Build ElasticJob configuration. * * @return ElasticJob configuration */ public final JobConfiguration build() { Preconditions.checkArgument(!Strings.isNullOrEmpty(jobName), "jobName can not be empty."); Preconditions.checkArgument(shardingTotalCount > 0, "shardingTotalCount should larger than zero."); return new JobConfiguration(jobName, cron, timeZone, shardingTotalCount, shardingItemParameters, jobParameter, monitorExecution, failover, misfire, maxTimeDiffSeconds, reconcileIntervalMinutes, jobShardingStrategyType, jobExecutorThreadPoolSizeProviderType, jobErrorHandlerType, jobListenerTypes, extraConfigurations, description, props, disabled, overwrite, label, staticSharding); } } } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfiguration.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.api; /** * Job extra configuration. */ public interface JobExtraConfiguration { } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.api; import java.util.Optional; /** * Job extra configuration factory. */ public interface JobExtraConfigurationFactory { /** * Get job extra configuration. * * @return job extra configuration */ Optional getJobExtraConfiguration(); } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/ExecutionType.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.executor; /** * Execution type. */ public enum ExecutionType { /** * Ready of execute. */ READY, /** * Failover execution. */ FAILOVER } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/error/handler/JobErrorHandler.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.executor.error.handler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; import java.io.Closeable; /** * Job error handler. */ public interface JobErrorHandler extends TypedSPI, Closeable { /** * Handle exception. * * @param jobName job name * @param cause failure cause */ void handleException(String jobName, Throwable cause); @Override String getType(); @Override default void close() { } } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/error/handler/JobErrorHandlerPropertiesValidator.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.executor.error.handler; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; import java.util.Properties; /** * Job error handler properties validator. */ @SingletonSPI public interface JobErrorHandlerPropertiesValidator extends TypedSPI { /** * Validate job properties. * * @param props job properties */ void validate(Properties props); } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/JobItemExecutor.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.executor.item; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; /** * Job item executor. * * @param type of ElasticJob */ public interface JobItemExecutor { /** * Process job item. * * @param elasticJob elastic job * @param jobConfig job configuration * @param jobRuntimeService job runtime service * @param shardingContext sharding context */ void process(T elasticJob, JobConfiguration jobConfig, JobRuntimeService jobRuntimeService, ShardingContext shardingContext); } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/param/JobRuntimeService.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.executor.item.param; /** * Job runtime service. */ public interface JobRuntimeService { /** * Judge job whether to need resharding. * * @return need resharding or not */ boolean isNeedSharding(); } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/param/ShardingContext.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.executor.item.param; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.ToString; /** * Sharding context. */ @RequiredArgsConstructor @Getter @ToString public final class ShardingContext { private final String jobName; private final String taskId; private final int shardingTotalCount; private final String jobParameter; private final int shardingItem; private final String shardingParameter; } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/type/ClassedJobItemExecutor.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.executor.item.type; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.spi.executor.item.JobItemExecutor; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; /** * Classed job item executor. * * @param type of ElasticJob */ @SingletonSPI public interface ClassedJobItemExecutor extends JobItemExecutor { /** * Get elastic job class. * * @return elastic job class */ Class getElasticJobClass(); } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/type/TypedJobItemExecutor.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.executor.item.type; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.spi.executor.item.JobItemExecutor; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; /** * Typed job item executor. */ @SingletonSPI public interface TypedJobItemExecutor extends JobItemExecutor, TypedSPI { } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/listener/ElasticJobListener.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.listener; import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; /** * ElasticJob listener. */ public interface ElasticJobListener extends TypedSPI { int LOWEST = Integer.MAX_VALUE; /** * Called before job executed. * * @param shardingContexts sharding contexts */ void beforeJobExecuted(ShardingContexts shardingContexts); /** * Called after job executed. * * @param shardingContexts sharding contexts */ void afterJobExecuted(ShardingContexts shardingContexts); /** * Listener order, default is the lowest. * @return order */ default int order() { return LOWEST; } } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContexts.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.listener.param; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import java.io.Serializable; import java.util.Map; /** * Sharding contexts. */ @RequiredArgsConstructor @Getter @ToString public final class ShardingContexts implements Serializable { private static final long serialVersionUID = -4585977349142082152L; private final String taskId; private final String jobName; private final int shardingTotalCount; private final String jobParameter; private final Map shardingItemParameters; private int jobEventSamplingCount; @Setter private int currentJobEventSamplingCount; @Setter private boolean allowSendJobEvent = true; public ShardingContexts(final String taskId, final String jobName, final int shardingTotalCount, final String jobParameter, final Map shardingItemParameters, final int jobEventSamplingCount) { this.taskId = taskId; this.jobName = jobName; this.shardingTotalCount = shardingTotalCount; this.jobParameter = jobParameter; this.shardingItemParameters = shardingItemParameters; this.jobEventSamplingCount = jobEventSamplingCount; } /** * Create sharding context. * * @param shardingItem sharding item * @return sharding context */ public ShardingContext createShardingContext(final int shardingItem) { return new ShardingContext(jobName, taskId, shardingTotalCount, jobParameter, shardingItem, shardingItemParameters.get(shardingItem)); } } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/event/JobEvent.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.tracing.event; /** * Job event. */ public interface JobEvent { /** * Get job name. * * @return job name */ String getJobName(); } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/event/JobExecutionEvent.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.tracing.event; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; import java.util.Date; import java.util.UUID; /** * Job execution event. */ @AllArgsConstructor @RequiredArgsConstructor @Getter public final class JobExecutionEvent implements JobEvent { private String id = UUID.randomUUID().toString(); private final String hostname; private final String ip; private final String taskId; private final String jobName; private final ExecutionSource source; private final int shardingItem; private Date startTime = new Date(); @Setter private Date completeTime; @Setter private boolean success; @Setter private String failureCause; /** * Execution success. * * @return job execution event */ public JobExecutionEvent executionSuccess() { JobExecutionEvent result = new JobExecutionEvent(id, hostname, ip, taskId, jobName, source, shardingItem, startTime, completeTime, success, failureCause); result.setCompleteTime(new Date()); result.setSuccess(true); return result; } /** * Execution failure. * * @param failureCause failure cause * @return job execution event */ public JobExecutionEvent executionFailure(final String failureCause) { JobExecutionEvent result = new JobExecutionEvent(id, hostname, ip, taskId, jobName, source, shardingItem, startTime, completeTime, success, failureCause); result.setCompleteTime(new Date()); result.setSuccess(false); result.setFailureCause(failureCause); return result; } /** * Execution source. */ public enum ExecutionSource { NORMAL_TRIGGER, MISFIRE, FAILOVER } } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/event/JobStatusTraceEvent.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.tracing.event; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; import org.apache.shardingsphere.elasticjob.spi.executor.ExecutionType; import java.util.Date; import java.util.UUID; /** * Job status trace event. */ @AllArgsConstructor @RequiredArgsConstructor @Getter public final class JobStatusTraceEvent implements JobEvent { private String id = UUID.randomUUID().toString(); private final String jobName; @Setter private String originalTaskId = ""; private final String taskId; private final String slaveId; private final ExecutionType executionType; private final String shardingItems; private final State state; private final String message; private Date creationTime = new Date(); public enum State { TASK_STAGING, TASK_RUNNING, TASK_FINISHED, TASK_KILLED, TASK_LOST, TASK_FAILED, TASK_ERROR, TASK_DROPPED, TASK_GONE, TASK_GONE_BY_OPERATOR, TASK_UNREACHABLE, TASK_UNKNOWN } } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/exception/TracingConfigurationException.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.tracing.exception; /** * Tracing configuration exception. */ public final class TracingConfigurationException extends Exception { private static final long serialVersionUID = 4069519372148227761L; public TracingConfigurationException(final Exception ex) { super(ex); } public TracingConfigurationException(final String errorMessage) { super(errorMessage); } } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/listener/TracingListener.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.tracing.listener; import com.google.common.eventbus.AllowConcurrentEvents; import com.google.common.eventbus.Subscribe; import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent; /** * Tracing listener. */ public interface TracingListener { /** * Listen job execution event. * * @param jobExecutionEvent job execution event */ @Subscribe @AllowConcurrentEvents void listen(JobExecutionEvent jobExecutionEvent); /** * Listen job status trace event. * * @param jobStatusTraceEvent job status trace event */ @Subscribe @AllowConcurrentEvents void listen(JobStatusTraceEvent jobStatusTraceEvent); } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/listener/TracingListenerFactory.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.tracing.listener; import org.apache.shardingsphere.elasticjob.spi.tracing.exception.TracingConfigurationException; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; /** * Tracing listener factory. * * @param type of tracing storage */ @SingletonSPI public interface TracingListenerFactory extends TypedSPI { /** * Create tracing listener. * * @param storage storage * @return tracing listener * @throws TracingConfigurationException tracing configuration exception */ TracingListener create(T storage) throws TracingConfigurationException; @Override String getType(); } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/storage/TracingStorageConfiguration.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.tracing.storage; /** * Tracing storage configuration. * * @param storage type */ public interface TracingStorageConfiguration { /** * Create storage. * * @return storage */ T getStorage(); } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/storage/TracingStorageConfigurationConverter.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.tracing.storage; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; /** * Tracing storage configuration converter. * * @param storage type */ @SingletonSPI public interface TracingStorageConfigurationConverter { /** * Convert storage to {@link TracingStorageConfiguration}. * * @param storage storage instance * @return instance of {@link TracingStorageConfiguration} */ TracingStorageConfiguration toConfiguration(T storage); /** * Storage type. * * @return class of storage */ Class storageType(); } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/yaml/YamlConfiguration.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.yaml; import java.io.Serializable; /** * YAML configuration. * * @param type of configuration */ public interface YamlConfiguration extends Serializable { /** * Convert to original configuration. * * @return configuration */ T toConfiguration(); } ================================================ FILE: api/src/main/java/org/apache/shardingsphere/elasticjob/spi/yaml/YamlConfigurationConverter.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.yaml; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; /** * YAML configuration converter. * * @param type of original configuration object * @param type of YAML configuration */ @SingletonSPI public interface YamlConfigurationConverter> extends TypedSPI { /** * Convert to YAML configuration. * * @param data data to be converted * @return YAML configuration */ Y convertToYamlConfiguration(T data); @Override Class getType(); } ================================================ FILE: api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.annotation; import org.apache.shardingsphere.elasticjob.annotation.job.impl.SimpleTestJob; import org.apache.shardingsphere.elasticjob.api.JobExtraConfigurationFactory; import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertArrayEquals; class ElasticJobConfigurationTest { @Test void assertAnnotationJob() { ElasticJobConfiguration annotation = SimpleTestJob.class.getAnnotation(ElasticJobConfiguration.class); assertThat(annotation.jobName(), is("SimpleTestJob")); assertThat(annotation.cron(), is("0/5 * * * * ?")); assertThat(annotation.shardingTotalCount(), is(3)); assertThat(annotation.shardingItemParameters(), is("0=Beijing,1=Shanghai,2=Guangzhou")); for (Class factory : annotation.extraConfigurations()) { assertThat(factory, is(SimpleTracingConfigurationFactory.class)); } assertArrayEquals(annotation.jobListenerTypes(), new String[]{"NOOP", "LOG"}); Queue propsKey = new LinkedList<>(Arrays.asList("print.title", "print.content")); Queue propsValue = new LinkedList<>(Arrays.asList("test title", "test content")); for (ElasticJobProp prop : annotation.props()) { assertThat(prop.key(), is(propsKey.poll())); assertThat(prop.value(), is(propsValue.poll())); } } } ================================================ FILE: api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/SimpleTracingConfigurationFactory.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.annotation; import java.util.Optional; import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; import org.apache.shardingsphere.elasticjob.api.JobExtraConfigurationFactory; public final class SimpleTracingConfigurationFactory implements JobExtraConfigurationFactory { @Override public Optional getJobExtraConfiguration() { return Optional.empty(); } } ================================================ FILE: api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.annotation.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; public interface CustomJob extends ElasticJob { /** * Execute custom job. * * @param shardingContext sharding context */ void execute(ShardingContext shardingContext); } ================================================ FILE: api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.annotation.job.impl; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; import org.apache.shardingsphere.elasticjob.annotation.SimpleTracingConfigurationFactory; import org.apache.shardingsphere.elasticjob.annotation.job.CustomJob; import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; @ElasticJobConfiguration( cron = "0/5 * * * * ?", jobName = "SimpleTestJob", shardingTotalCount = 3, shardingItemParameters = "0=Beijing,1=Shanghai,2=Guangzhou", jobListenerTypes = {"NOOP", "LOG"}, extraConfigurations = SimpleTracingConfigurationFactory.class, props = { @ElasticJobProp(key = "print.title", value = "test title"), @ElasticJobProp(key = "print.content", value = "test content") }) public final class SimpleTestJob implements CustomJob { @Override public void execute(final ShardingContext shardingContext) { } } ================================================ FILE: api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.api; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; class JobConfigurationTest { @Test void assertBuildAllProperties() { JobConfiguration actual = JobConfiguration.newBuilder("test_job", 3) .cron("0/1 * * * * ?") .timeZone("GMT+8") .shardingItemParameters("0=a,1=b,2=c").jobParameter("param") .monitorExecution(false).failover(true).misfire(false) .maxTimeDiffSeconds(1000).reconcileIntervalMinutes(60) .jobShardingStrategyType("AVG_ALLOCATION").jobExecutorThreadPoolSizeProviderType("SINGLE_THREAD").jobErrorHandlerType("IGNORE") .description("desc").setProperty("key", "value") .disabled(true).overwrite(true).build(); assertThat(actual.getJobName(), is("test_job")); assertThat(actual.getCron(), is("0/1 * * * * ?")); assertThat(actual.getTimeZone(), is("GMT+8")); assertThat(actual.getShardingTotalCount(), is(3)); assertThat(actual.getShardingItemParameters(), is("0=a,1=b,2=c")); assertThat(actual.getJobParameter(), is("param")); assertFalse(actual.isMonitorExecution()); assertTrue(actual.isFailover()); assertFalse(actual.isMisfire()); assertThat(actual.getMaxTimeDiffSeconds(), is(1000)); assertThat(actual.getReconcileIntervalMinutes(), is(60)); assertThat(actual.getJobShardingStrategyType(), is("AVG_ALLOCATION")); assertThat(actual.getJobExecutorThreadPoolSizeProviderType(), is("SINGLE_THREAD")); assertThat(actual.getJobErrorHandlerType(), is("IGNORE")); assertThat(actual.getDescription(), is("desc")); assertThat(actual.getProps().getProperty("key"), is("value")); assertTrue(actual.isDisabled()); assertTrue(actual.isOverwrite()); } @Test public void assertBuildRequiredProperties() { JobConfiguration actual = JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").timeZone("GMT+8").build(); assertThat(actual.getJobName(), is("test_job")); assertThat(actual.getCron(), is("0/1 * * * * ?")); assertThat(actual.getTimeZone(), is("GMT+8")); assertThat(actual.getShardingTotalCount(), is(3)); assertThat(actual.getShardingItemParameters(), is("")); assertThat(actual.getJobParameter(), is("")); assertTrue(actual.isMonitorExecution()); assertFalse(actual.isFailover()); assertTrue(actual.isMisfire()); assertThat(actual.getMaxTimeDiffSeconds(), is(-1)); assertThat(actual.getReconcileIntervalMinutes(), is(10)); assertNull(actual.getJobShardingStrategyType()); assertNull(actual.getJobExecutorThreadPoolSizeProviderType()); assertNull(actual.getJobErrorHandlerType()); assertThat(actual.getDescription(), is("")); assertTrue(actual.getProps().isEmpty()); assertFalse(actual.isDisabled()); assertFalse(actual.isOverwrite()); } @Test void assertBuildWithEmptyJobName() { assertThrows(IllegalArgumentException.class, () -> JobConfiguration.newBuilder("", 3).cron("0/1 * * * * ?").build()); } @Test void assertBuildWithInvalidShardingTotalCount() { assertThrows(IllegalArgumentException.class, () -> JobConfiguration.newBuilder("test_job", -1).cron("0/1 * * * * ?").build()); } } ================================================ FILE: api/src/test/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContextsTest.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.spi.listener.param; import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.junit.jupiter.api.Test; import java.util.HashMap; import java.util.Map; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; class ShardingContextsTest { @Test void assertCreateShardingContext() { ShardingContexts shardingContexts = createShardingContexts(); ShardingContext actual = shardingContexts.createShardingContext(1); assertThat(actual.getJobName(), is(shardingContexts.getJobName())); assertThat(actual.getTaskId(), is(shardingContexts.getTaskId())); assertThat(actual.getShardingTotalCount(), is(shardingContexts.getShardingTotalCount())); assertThat(actual.getJobParameter(), is(shardingContexts.getJobParameter())); assertThat(actual.getShardingItem(), is(1)); assertThat(actual.getShardingParameter(), is(shardingContexts.getShardingItemParameters().get(1))); } private ShardingContexts createShardingContexts() { Map map = new HashMap<>(2, 1F); map.put(0, "A"); map.put(1, "B"); return new ShardingContexts("fake_task_id", "test_job", 2, "", map); } } ================================================ FILE: bootstrap/pom.xml ================================================ 4.0.0 org.apache.shardingsphere.elasticjob elasticjob 3.0.6-SNAPSHOT elasticjob-bootstrap ${project.artifactId} org.apache.shardingsphere.elasticjob elasticjob-kernel ${project.parent.version} org.apache.shardingsphere.elasticjob elasticjob-simple-executor ${project.parent.version} org.apache.shardingsphere.elasticjob elasticjob-dataflow-executor ${project.parent.version} org.apache.shardingsphere.elasticjob elasticjob-script-executor ${project.parent.version} org.apache.shardingsphere.elasticjob elasticjob-http-executor ${project.parent.version} org.apache.shardingsphere.elasticjob elasticjob-error-handler-normal ${project.parent.version} org.apache.shardingsphere.elasticjob elasticjob-tracing-rdb ${project.parent.version} org.apache.shardingsphere.elasticjob elasticjob-reachability-metadata ${project.version} org.apache.shardingsphere.elasticjob elasticjob-test-util ${project.parent.version} test org.awaitility awaitility ================================================ FILE: bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/JobBootstrap.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.bootstrap; /** * Job bootstrap. */ public interface JobBootstrap { /** * Shutdown job. */ void shutdown(); } ================================================ FILE: bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrap.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.bootstrap.type; 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.bootstrap.JobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.annotation.JobAnnotationBuilder; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; /** * One off job bootstrap. */ public class OneOffJobBootstrap implements JobBootstrap { private final JobScheduler jobScheduler; private final InstanceService instanceService; public OneOffJobBootstrap(final CoordinatorRegistryCenter regCenter, final ElasticJob elasticJob, final JobConfiguration jobConfig) { Preconditions.checkArgument(Strings.isNullOrEmpty(jobConfig.getCron()), "Cron should be empty."); jobScheduler = new JobScheduler(regCenter, elasticJob, jobConfig); instanceService = new InstanceService(regCenter, jobConfig.getJobName()); } public OneOffJobBootstrap(final CoordinatorRegistryCenter regCenter, final String elasticJobType, final JobConfiguration jobConfig) { Preconditions.checkArgument(Strings.isNullOrEmpty(jobConfig.getCron()), "Cron should be empty."); jobScheduler = new JobScheduler(regCenter, elasticJobType, jobConfig); instanceService = new InstanceService(regCenter, jobConfig.getJobName()); } public OneOffJobBootstrap(final CoordinatorRegistryCenter regCenter, final ElasticJob elasticJob) { JobConfiguration jobConfig = JobAnnotationBuilder.generateJobConfiguration(elasticJob.getClass()); jobScheduler = new JobScheduler(regCenter, elasticJob, jobConfig); instanceService = new InstanceService(regCenter, jobConfig.getJobName()); } /** * Execute job. */ public void execute() { instanceService.triggerAllInstances(); } @Override public void shutdown() { jobScheduler.shutdown(); } } ================================================ FILE: bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/type/ScheduleJobBootstrap.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.bootstrap.type; 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.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; /** * Schedule job bootstrap. */ public final class ScheduleJobBootstrap implements JobBootstrap { private final JobScheduler jobScheduler; public ScheduleJobBootstrap(final CoordinatorRegistryCenter regCenter, final ElasticJob elasticJob, final JobConfiguration jobConfig) { jobScheduler = new JobScheduler(regCenter, elasticJob, jobConfig); } public ScheduleJobBootstrap(final CoordinatorRegistryCenter regCenter, final String elasticJobType, final JobConfiguration jobConfig) { jobScheduler = new JobScheduler(regCenter, elasticJobType, jobConfig); } public ScheduleJobBootstrap(final CoordinatorRegistryCenter regCenter, final ElasticJob elasticJob) { JobConfiguration jobConfig = JobAnnotationBuilder.generateJobConfiguration(elasticJob.getClass()); jobScheduler = new JobScheduler(regCenter, elasticJob, jobConfig); } /** * Schedule job. */ public void schedule() { Preconditions.checkArgument(!Strings.isNullOrEmpty(jobScheduler.getJobConfig().getCron()), "Cron can not be empty."); jobScheduler.getJobScheduleController().scheduleJob(jobScheduler.getJobConfig().getCron(), jobScheduler.getJobConfig().getTimeZone()); } @Override public void shutdown() { jobScheduler.shutdown(); } } ================================================ FILE: bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrapTest.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.bootstrap.type; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.quartz.Scheduler; import org.quartz.SchedulerException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; class OneOffJobBootstrapTest { private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); private static final int SHARDING_TOTAL_COUNT = 3; private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void init() { EMBED_TESTING_SERVER.start(); ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), OneOffJobBootstrapTest.class.getSimpleName()); zkRegCenter = new ZookeeperRegistryCenter(zookeeperConfiguration); zkRegCenter.init(); } @AfterAll static void tearDown() { zkRegCenter.close(); } @Test void assertConfigFailedWithCron() { assertThrows(IllegalArgumentException.class, () -> new OneOffJobBootstrap(zkRegCenter, (SimpleJob) shardingContext -> { }, JobConfiguration.newBuilder("test_one_off_job_execute_with_config_cron", SHARDING_TOTAL_COUNT).cron("0/5 * * * * ?").build())); } @Test void assertExecute() { AtomicInteger counter = new AtomicInteger(0); final OneOffJobBootstrap oneOffJobBootstrap = new OneOffJobBootstrap(zkRegCenter, (SimpleJob) shardingContext -> counter.incrementAndGet(), JobConfiguration.newBuilder("test_one_off_job_execute", SHARDING_TOTAL_COUNT).build()); oneOffJobBootstrap.execute(); blockUtilFinish(oneOffJobBootstrap, counter); assertThat(counter.get(), is(SHARDING_TOTAL_COUNT)); ((JobScheduler) ReflectionUtils.getFieldValue(oneOffJobBootstrap, "jobScheduler")).shutdown(); } @Test void assertShutdown() throws SchedulerException { OneOffJobBootstrap oneOffJobBootstrap = new OneOffJobBootstrap(zkRegCenter, (SimpleJob) shardingContext -> { }, JobConfiguration.newBuilder("test_one_off_job_shutdown", SHARDING_TOTAL_COUNT).build()); oneOffJobBootstrap.shutdown(); assertTrue(getScheduler(oneOffJobBootstrap).isShutdown()); } private Scheduler getScheduler(final OneOffJobBootstrap oneOffJobBootstrap) { JobScheduler jobScheduler = (JobScheduler) ReflectionUtils.getFieldValue(oneOffJobBootstrap, "jobScheduler"); return (Scheduler) ReflectionUtils.getFieldValue(jobScheduler.getJobScheduleController(), "scheduler"); } private void blockUtilFinish(final OneOffJobBootstrap oneOffJobBootstrap, final AtomicInteger counter) { Scheduler scheduler = getScheduler(oneOffJobBootstrap); Awaitility.await().pollDelay(100L, TimeUnit.MILLISECONDS).until(() -> 0 != counter.get() && scheduler.getCurrentlyExecutingJobs().isEmpty()); } } ================================================ FILE: bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/type/ScheduleJobBootstrapTest.java ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.bootstrap.type; import lombok.extern.slf4j.Slf4j; import org.apache.curator.CuratorZookeeperClient; import org.apache.curator.retry.ExponentialBackoffRetry; import org.apache.curator.test.TestingServer; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.quartz.core.JobRunShell; import org.slf4j.LoggerFactory; import java.io.IOException; import java.time.Duration; import java.time.LocalTime; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Logger; @Slf4j class ScheduleJobBootstrapTest { private TestingServer testingServer; private CoordinatorRegistryCenter regCenter; @BeforeEach void beforeEach() throws Exception { testingServer = new TestingServer(); try ( CuratorZookeeperClient client = new CuratorZookeeperClient(testingServer.getConnectString(), 60000, 500, null, new ExponentialBackoffRetry(500, 3, 1500))) { client.start(); Awaitility.await().atMost(Duration.ofSeconds(30L)).ignoreExceptions().until(client::isConnected); } regCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test")); regCenter.init(); } @AfterEach void afterEach() throws IOException { regCenter.close(); testingServer.close(); } @Test void testWhenShutdownThenTaskCanCaptureInterruptedException() { Logger jobRunShell = (Logger) LoggerFactory.getLogger(JobRunShell.class.getName()); Logger errorLogger = (Logger) LoggerFactory.getLogger("org.quartz.core.ErrorLogger"); Level originJobRunShellLevel = jobRunShell.getLevel(); Level originErrorLoggerLevel = errorLogger.getLevel(); try { jobRunShell.setLevel(Level.OFF); errorLogger.setLevel(Level.OFF); testCaptureInterruptedException(1); testCaptureInterruptedException(2); } finally { jobRunShell.setLevel(originJobRunShellLevel); errorLogger.setLevel(originErrorLoggerLevel); } } @SuppressWarnings({"InfiniteLoopStatement", "BusyWait"}) private void testCaptureInterruptedException(final int shardingTotalCount) { String jobName = "testTaskCaptureInterruptedTask" + shardingTotalCount; AtomicBoolean captured = new AtomicBoolean(false); AtomicBoolean running = new AtomicBoolean(false); LocalTime magicTime = LocalTime.now().plusSeconds(2L); String cronExpression = String.format("%d %d %d * * ?", magicTime.getSecond(), magicTime.getMinute(), magicTime.getHour()); SimpleJob job = shardingContext -> { try { running.set(true); while (true) { Thread.sleep(100L); } } catch (final InterruptedException ex) { captured.set(true); Thread.currentThread().interrupt(); } }; ScheduleJobBootstrap bootstrap = new ScheduleJobBootstrap(regCenter, job, JobConfiguration.newBuilder(jobName, shardingTotalCount).cron(cronExpression).build()); bootstrap.schedule(); Awaitility.await().atMost(30L, TimeUnit.SECONDS).ignoreExceptions().until(running::get); bootstrap.shutdown(); Awaitility.await().atMost(10L, TimeUnit.SECONDS).ignoreExceptions().until(captured::get); } } ================================================ FILE: bootstrap/src/test/resources/logback-test.xml ================================================ ${log.context.name} ERROR ${log.pattern} ================================================ FILE: distribution/bin/pom.xml ================================================ 4.0.0 org.apache.shardingsphere.elasticjob elasticjob-distribution 3.0.6-SNAPSHOT elasticjob-bin-distribution pom ${project.artifactId} org.apache.shardingsphere.elasticjob elasticjob-bootstrap ${project.version} org.apache.shardingsphere.elasticjob elasticjob-spring-namespace ${project.version} org.apache.shardingsphere.elasticjob elasticjob-spring-boot-starter ${project.version} org.apache.shardingsphere.elasticjob elasticjob-error-handler-dingtalk ${project.version} org.apache.shardingsphere.elasticjob elasticjob-error-handler-email ${project.version} org.apache.shardingsphere.elasticjob elasticjob-error-handler-wechat ${project.version} release maven-assembly-plugin lite-bin single package src/main/assembly/elasticjob-binary-distribution.xml net.nicoulaj.maven.plugins checksum-maven-plugin ================================================ FILE: distribution/bin/src/main/assembly/elasticjob-binary-distribution.xml ================================================ lite-bin tar.gz true ${project.build.finalName}-bin ../../ LICENSE NOTICE src/main/release-docs **/* . true false ./lib org.apache.shardingsphere.elasticjob:* ================================================ FILE: distribution/bin/src/main/release-docs/README.txt ================================================ Welcome to Apache ShardingSphere-ElasticJob =============================================================================== ElasticJob is a distributed scheduling solution. Through the functions of flexible scheduling, resource management and job management, it creates a distributed scheduling solution suitable for Internet scenarios, and provides a diversified job ecosystem through open architecture design. It uses a unified job API for each project. Developers only need code one time and can deploy at will. ElasticJob is a lightweight, decentralized solution that provides distributed task sharding services. ElasticJob became an Apache ShardingSphere Sub project on May 28 2020. Getting Started =============================================================================== To help you get started, try the following links: Getting Started https://shardingsphere.apache.org/elasticjob/current/en/quick-start/ We welcome contributions of all kinds, for details of how you can help https://shardingsphere.apache.org/community/en/contribute/ Find the issue tracker from here https://github.com/apache/shardingsphere-elasticjob/issues Please help us make Apache ShardingSphere-ElasticJob better - we appreciate any feedback you may have. Have fun! ================================================ FILE: distribution/pom.xml ================================================ 4.0.0 org.apache.shardingsphere.elasticjob elasticjob 3.0.6-SNAPSHOT elasticjob-distribution pom ${project.artifactId} src bin true ================================================ FILE: distribution/src/pom.xml ================================================ 4.0.0 org.apache.shardingsphere.elasticjob elasticjob-distribution 3.0.6-SNAPSHOT elasticjob-src-distribution pom ${project.artifactId} release maven-assembly-plugin src single package src/main/assembly/source-distribution.xml net.nicoulaj.maven.plugins checksum-maven-plugin ================================================ FILE: distribution/src/src/main/assembly/source-distribution.xml ================================================ src zip true ${project.build.finalName}-src-release ../../ true **/* **/.github/** .travis.yml **/target/** **/*.class **/*.jar **/*.war **/*.zip **/*.tar **/*.tar.gz **/.flattened-pom.xml release.properties **/pom.xml.releaseBackup **/cobertura.ser *.gpg **/.settings/** **/.project **/.classpath **/.idea/** **/*.ipr **/*.iml **/*.iws **/logs/** **/*.log **/*.doc **/*.cache **/*.diff **/*.patch **/*.tmp **/.DS_Store **/Thumbs.db docs/** examples/** ================================================ FILE: docs/README.md ================================================ 本文档使用[hugo](http://gohugo.io/overview/introduction/)生成文档。 同时使用主题[hugo theme learn](https://github.com/matcornic/hugo-theme-learn)来作为文档风格。 ================================================ FILE: docs/archetypes/default.md ================================================ --- title: "{{ replace .Name "-" " " | title }}" date: {{ .Date }} draft: true --- ================================================ FILE: docs/build.sh ================================================ #!/bin/bash cd `dirname $0` rm -rf public hugo find ./ -name '*.html' -exec sed -i -e 's|[[:space:]]*