├── README.md └── elasticjob-cloud ├── .asf.yaml ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── README_ZH.md ├── RELEASE-NOTES.md ├── ROADMAP.md ├── docs ├── README.md ├── config.toml ├── content │ ├── 00-overview │ │ ├── contribution.md │ │ ├── index.md │ │ └── intro.md │ ├── 01-start │ │ ├── deploy-guide.md │ │ ├── dev-guide.md │ │ ├── faq.md │ │ ├── index.md │ │ └── quick-start.md │ ├── 02-guide │ │ ├── cloud-concepts.md │ │ ├── cloud-restful-api.md │ │ ├── cloud-web-console.md │ │ ├── event-trace.md │ │ ├── high-availability.md │ │ ├── index.md │ │ └── local-executor.md │ └── 03-design │ │ ├── index.md │ │ ├── module.md │ │ └── roadmap.md ├── layouts │ ├── index.html │ └── partials │ │ ├── logo.html │ │ ├── script.html │ │ └── style.html ├── static │ ├── css │ │ └── style.css │ ├── data │ │ └── chart.js │ ├── dist │ │ └── elastic-job-cloud-scheduler-2.1.2.tar.gz │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ └── img │ │ ├── architecture │ │ └── elastic_job_cloud.png │ │ ├── elastic-job.png │ │ └── license.svg └── themes │ └── hugo-theme-learn │ ├── LICENSE.md │ ├── archetypes │ ├── chapter.md │ └── default.md │ ├── layouts │ ├── 404.html │ ├── _default │ │ ├── list.html │ │ └── single.html │ ├── partials │ │ ├── favicon.html │ │ ├── footer.html │ │ ├── header.html │ │ ├── logo.html │ │ ├── menu.html │ │ ├── meta.html │ │ ├── script.html │ │ ├── style.html │ │ └── toc.html │ └── shortcodes │ │ ├── button.html │ │ └── notice.html │ ├── static │ ├── css │ │ ├── featherlight.min.css │ │ ├── font-awesome.min.css │ │ ├── horsey.css │ │ ├── hugo-theme.css │ │ ├── hybrid.css │ │ ├── nucleus.css │ │ ├── perfect-scrollbar.min.css │ │ └── theme.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── Inconsolata.eot │ │ ├── Inconsolata.svg │ │ ├── Inconsolata.ttf │ │ ├── Inconsolata.woff │ │ ├── Novecentosanswide-Normal-webfont.eot │ │ ├── Novecentosanswide-Normal-webfont.svg │ │ ├── Novecentosanswide-Normal-webfont.ttf │ │ ├── Novecentosanswide-Normal-webfont.woff │ │ ├── Novecentosanswide-Normal-webfont.woff2 │ │ ├── Novecentosanswide-UltraLight-webfont.eot │ │ ├── Novecentosanswide-UltraLight-webfont.svg │ │ ├── Novecentosanswide-UltraLight-webfont.ttf │ │ ├── Novecentosanswide-UltraLight-webfont.woff │ │ ├── Novecentosanswide-UltraLight-webfont.woff2 │ │ ├── Work_Sans_200.eot │ │ ├── Work_Sans_200.svg │ │ ├── Work_Sans_200.ttf │ │ ├── Work_Sans_200.woff │ │ ├── Work_Sans_200.woff2 │ │ ├── Work_Sans_300.eot │ │ ├── Work_Sans_300.svg │ │ ├── Work_Sans_300.ttf │ │ ├── Work_Sans_300.woff │ │ ├── Work_Sans_300.woff2 │ │ ├── Work_Sans_500.eot │ │ ├── Work_Sans_500.svg │ │ ├── Work_Sans_500.ttf │ │ ├── Work_Sans_500.woff │ │ ├── Work_Sans_500.woff2 │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── images │ │ ├── clippy.svg │ │ ├── favicon.png │ │ └── gopher-404.jpg │ ├── js │ │ ├── clipboard.min.js │ │ ├── featherlight.min.js │ │ ├── highlight.pack.js │ │ ├── horsey.js │ │ ├── html5shiv-printshiv.min.js │ │ ├── hugo-learn.js │ │ ├── jquery-2.x.min.js │ │ ├── jquery.sticky-kit.min.js │ │ ├── learn.js │ │ ├── lunr.min.js │ │ ├── modernizr.custom.71422.js │ │ ├── perfect-scrollbar.jquery.min.js │ │ ├── perfect-scrollbar.min.js │ │ └── search.js │ └── json │ │ └── search.json │ └── theme.toml ├── elastic-job-cloud-common ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── shardingsphere │ │ └── elasticjob │ │ └── cloud │ │ ├── api │ │ ├── ElasticJob.java │ │ ├── JobType.java │ │ ├── ShardingContext.java │ │ ├── dataflow │ │ │ └── DataflowJob.java │ │ ├── script │ │ │ └── ScriptJob.java │ │ └── simple │ │ │ └── SimpleJob.java │ │ ├── config │ │ ├── JobCoreConfiguration.java │ │ ├── JobRootConfiguration.java │ │ ├── JobTypeConfiguration.java │ │ ├── dataflow │ │ │ └── DataflowJobConfiguration.java │ │ ├── script │ │ │ └── ScriptJobConfiguration.java │ │ └── simple │ │ │ └── SimpleJobConfiguration.java │ │ ├── context │ │ ├── ExecutionType.java │ │ └── TaskContext.java │ │ ├── event │ │ ├── JobEvent.java │ │ ├── JobEventBus.java │ │ ├── JobEventConfiguration.java │ │ ├── JobEventIdentity.java │ │ ├── JobEventListener.java │ │ ├── JobEventListenerConfigurationException.java │ │ ├── rdb │ │ │ ├── DatabaseType.java │ │ │ ├── JobEventRdbConfiguration.java │ │ │ ├── JobEventRdbIdentity.java │ │ │ ├── JobEventRdbListener.java │ │ │ ├── JobEventRdbSearch.java │ │ │ └── JobEventRdbStorage.java │ │ └── type │ │ │ ├── JobExecutionEvent.java │ │ │ ├── JobExecutionEventThrowable.java │ │ │ └── JobStatusTraceEvent.java │ │ ├── exception │ │ ├── AppConfigurationException.java │ │ ├── ExceptionUtil.java │ │ ├── JobConfigurationException.java │ │ ├── JobExecutionEnvironmentException.java │ │ ├── JobStatisticException.java │ │ └── JobSystemException.java │ │ ├── executor │ │ ├── AbstractElasticJobExecutor.java │ │ ├── JobExecutorFactory.java │ │ ├── JobFacade.java │ │ ├── ShardingContexts.java │ │ ├── handler │ │ │ ├── ExecutorServiceHandler.java │ │ │ ├── ExecutorServiceHandlerRegistry.java │ │ │ ├── JobExceptionHandler.java │ │ │ ├── JobProperties.java │ │ │ └── impl │ │ │ │ ├── DefaultExecutorServiceHandler.java │ │ │ │ └── DefaultJobExceptionHandler.java │ │ └── type │ │ │ ├── DataflowJobExecutor.java │ │ │ ├── ScriptJobExecutor.java │ │ │ └── SimpleJobExecutor.java │ │ ├── reg │ │ ├── base │ │ │ ├── CoordinatorRegistryCenter.java │ │ │ ├── ElectionCandidate.java │ │ │ └── RegistryCenter.java │ │ ├── exception │ │ │ ├── RegException.java │ │ │ └── RegExceptionHandler.java │ │ └── zookeeper │ │ │ ├── ZookeeperConfiguration.java │ │ │ ├── ZookeeperElectionService.java │ │ │ └── ZookeeperRegistryCenter.java │ │ ├── statistics │ │ ├── StatisticInterval.java │ │ ├── rdb │ │ │ └── StatisticRdbRepository.java │ │ └── type │ │ │ ├── job │ │ │ ├── JobExecutionTypeStatistics.java │ │ │ ├── JobRegisterStatistics.java │ │ │ ├── JobRunningStatistics.java │ │ │ └── JobTypeStatistics.java │ │ │ └── task │ │ │ ├── TaskResultStatistics.java │ │ │ └── TaskRunningStatistics.java │ │ └── util │ │ ├── concurrent │ │ ├── BlockUtils.java │ │ └── ExecutorServiceObject.java │ │ ├── config │ │ ├── ShardingItemParameters.java │ │ └── ShardingItems.java │ │ ├── digest │ │ └── Encryption.java │ │ ├── env │ │ ├── HostException.java │ │ ├── IpUtils.java │ │ └── TimeService.java │ │ └── json │ │ ├── AbstractJobConfigurationGsonTypeAdapter.java │ │ └── GsonFactory.java │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── shardingsphere │ │ └── elasticjob │ │ └── cloud │ │ ├── AllCoreTests.java │ │ ├── api │ │ ├── AllApiTests.java │ │ └── ShardingContextTest.java │ │ ├── config │ │ ├── AllConfigTests.java │ │ └── JobCoreConfigurationTest.java │ │ ├── context │ │ ├── AllContextTests.java │ │ └── TaskContextTest.java │ │ ├── event │ │ ├── AllEventTests.java │ │ ├── JobEventBusTest.java │ │ ├── JobExecutionEventTest.java │ │ ├── fixture │ │ │ ├── JobEventCaller.java │ │ │ ├── TestJobEventConfiguration.java │ │ │ ├── TestJobEventFailureConfiguration.java │ │ │ ├── TestJobEventIdentity.java │ │ │ └── TestJobEventListener.java │ │ └── rdb │ │ │ ├── JobEventRdbConfigurationTest.java │ │ │ ├── JobEventRdbIdentityTest.java │ │ │ ├── JobEventRdbListenerTest.java │ │ │ ├── JobEventRdbSearchTest.java │ │ │ └── JobEventRdbStorageTest.java │ │ ├── exception │ │ ├── AllExceptionTests.java │ │ ├── ExceptionUtilTest.java │ │ ├── JobConfigurationExceptionTest.java │ │ ├── JobExecutionEnvironmentExceptionTest.java │ │ ├── JobStatisticExceptionTest.java │ │ └── JobSystemExceptionTest.java │ │ ├── executor │ │ ├── AllExecutorTests.java │ │ ├── JobExecutorFactoryTest.java │ │ ├── handler │ │ │ ├── ExecutorServiceHandlerRegistryTest.java │ │ │ ├── JobPropertiesTest.java │ │ │ └── impl │ │ │ │ └── DefaultJobExceptionHandlerTest.java │ │ └── type │ │ │ ├── DataflowJobExecutorTest.java │ │ │ ├── ElasticJobVerify.java │ │ │ ├── ScriptJobExecutorTest.java │ │ │ ├── SimpleJobExecutorTest.java │ │ │ └── WrongJobExecutorTest.java │ │ ├── fixture │ │ ├── APIJsonConstants.java │ │ ├── EmbedTestingServer.java │ │ ├── ShardingContextsBuilder.java │ │ ├── config │ │ │ ├── TestDataflowJobConfiguration.java │ │ │ ├── TestJobRootConfiguration.java │ │ │ ├── TestScriptJobConfiguration.java │ │ │ └── TestSimpleJobConfiguration.java │ │ ├── context │ │ │ └── TaskNode.java │ │ ├── handler │ │ │ ├── IgnoreJobExceptionHandler.java │ │ │ └── ThrowJobExceptionHandler.java │ │ └── job │ │ │ ├── JobCaller.java │ │ │ ├── OtherJob.java │ │ │ ├── TestDataflowJob.java │ │ │ ├── TestSimpleJob.java │ │ │ └── TestWrongJob.java │ │ ├── reg │ │ ├── AllRegTests.java │ │ ├── exception │ │ │ └── RegExceptionHandlerTest.java │ │ └── zookeeper │ │ │ ├── ZookeeperConfigurationTest.java │ │ │ ├── ZookeeperElectionServiceTest.java │ │ │ ├── ZookeeperRegistryCenterForAuthTest.java │ │ │ ├── ZookeeperRegistryCenterInitFailureTest.java │ │ │ ├── ZookeeperRegistryCenterMiscellaneousTest.java │ │ │ ├── ZookeeperRegistryCenterModifyTest.java │ │ │ ├── ZookeeperRegistryCenterQueryWithCacheTest.java │ │ │ ├── ZookeeperRegistryCenterQueryWithoutCacheTest.java │ │ │ └── util │ │ │ └── ZookeeperRegistryCenterTestUtil.java │ │ ├── statistics │ │ ├── AllStatisticsTests.java │ │ └── rdb │ │ │ └── StatisticRdbRepositoryTest.java │ │ └── util │ │ ├── AllUtilTests.java │ │ ├── concurrent │ │ └── ExecutorServiceObjectTest.java │ │ ├── config │ │ ├── ShardingItemParametersTest.java │ │ └── ShardingItemsTest.java │ │ ├── digest │ │ └── EncryptionTest.java │ │ ├── env │ │ ├── HostExceptionTest.java │ │ ├── IpUtilsTest.java │ │ └── TimeServiceTest.java │ │ └── json │ │ ├── GsonFactoryTest.java │ │ └── JobConfigurationGsonTypeAdapterTest.java │ └── resources │ ├── conf │ └── reg │ │ ├── local.properties │ │ └── local_overwrite.properties │ └── logback-test.xml ├── elastic-job-cloud-executor ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── shardingsphere │ │ └── elasticjob │ │ └── cloud │ │ ├── api │ │ └── JobBootstrap.java │ │ └── executor │ │ ├── CloudJobFacade.java │ │ ├── DaemonTaskScheduler.java │ │ ├── JobConfigurationContext.java │ │ ├── TaskExecutor.java │ │ └── local │ │ ├── LocalCloudJobConfiguration.java │ │ └── LocalTaskExecutor.java │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── shardingsphere │ │ └── elasticjob │ │ └── cloud │ │ └── executor │ │ ├── AllCloudExecutorTests.java │ │ ├── CloudJobFacadeTest.java │ │ ├── DaemonTaskSchedulerTest.java │ │ ├── JobConfigurationContextTest.java │ │ ├── TaskExecutorTest.java │ │ ├── TaskExecutorThreadTest.java │ │ ├── fixture │ │ ├── TestJob.java │ │ └── TestScriptJobConfiguration.java │ │ └── local │ │ ├── AllLocalExecutorTests.java │ │ ├── LocalTaskExecutorTest.java │ │ └── fixture │ │ ├── TestDataflowJob.java │ │ └── TestSimpleJob.java │ └── resources │ ├── applicationContext.xml │ ├── logback-test.xml │ └── script │ ├── TestScriptJob.bat │ └── TestScriptJob.sh ├── elastic-job-cloud-scheduler ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── shardingsphere │ │ │ └── elasticjob │ │ │ └── cloud │ │ │ ├── restful │ │ │ ├── GsonJsonProvider.java │ │ │ ├── RestfulException.java │ │ │ ├── RestfulExceptionMapper.java │ │ │ └── RestfulServer.java │ │ │ ├── scheduler │ │ │ ├── Bootstrap.java │ │ │ ├── config │ │ │ │ ├── app │ │ │ │ │ ├── CloudAppConfiguration.java │ │ │ │ │ ├── CloudAppConfigurationGsonFactory.java │ │ │ │ │ ├── CloudAppConfigurationNode.java │ │ │ │ │ └── CloudAppConfigurationService.java │ │ │ │ ├── constants │ │ │ │ │ └── CloudConfigurationConstants.java │ │ │ │ └── job │ │ │ │ │ ├── CloudJobConfiguration.java │ │ │ │ │ ├── CloudJobConfigurationGsonFactory.java │ │ │ │ │ ├── CloudJobConfigurationListener.java │ │ │ │ │ ├── CloudJobConfigurationNode.java │ │ │ │ │ ├── CloudJobConfigurationService.java │ │ │ │ │ └── CloudJobExecutionType.java │ │ │ ├── context │ │ │ │ └── JobContext.java │ │ │ ├── env │ │ │ │ ├── BootstrapEnvironment.java │ │ │ │ ├── FrameworkConfiguration.java │ │ │ │ ├── MesosConfiguration.java │ │ │ │ └── RestfulServerConfiguration.java │ │ │ ├── ha │ │ │ │ ├── FrameworkIDService.java │ │ │ │ ├── HANode.java │ │ │ │ └── SchedulerElectionCandidate.java │ │ │ ├── mesos │ │ │ │ ├── AppConstraintEvaluator.java │ │ │ │ ├── FacadeService.java │ │ │ │ ├── JobTaskRequest.java │ │ │ │ ├── LaunchingTasks.java │ │ │ │ ├── LeasesQueue.java │ │ │ │ ├── MesosStateService.java │ │ │ │ ├── ReconcileService.java │ │ │ │ ├── SchedulerEngine.java │ │ │ │ ├── SchedulerService.java │ │ │ │ ├── SupportedExtractionType.java │ │ │ │ ├── TaskInfoData.java │ │ │ │ └── TaskLaunchScheduledService.java │ │ │ ├── producer │ │ │ │ ├── ProducerManager.java │ │ │ │ ├── TransientProducerRepository.java │ │ │ │ └── TransientProducerScheduler.java │ │ │ ├── restful │ │ │ │ ├── CloudAppRestfulApi.java │ │ │ │ ├── CloudJobRestfulApi.java │ │ │ │ ├── CloudOperationRestfulApi.java │ │ │ │ └── RestfulService.java │ │ │ ├── state │ │ │ │ ├── StateNode.java │ │ │ │ ├── disable │ │ │ │ │ ├── app │ │ │ │ │ │ ├── DisableAppNode.java │ │ │ │ │ │ └── DisableAppService.java │ │ │ │ │ └── job │ │ │ │ │ │ ├── DisableJobNode.java │ │ │ │ │ │ └── DisableJobService.java │ │ │ │ ├── failover │ │ │ │ │ ├── FailoverNode.java │ │ │ │ │ ├── FailoverService.java │ │ │ │ │ └── FailoverTaskInfo.java │ │ │ │ ├── ready │ │ │ │ │ ├── ReadyNode.java │ │ │ │ │ └── ReadyService.java │ │ │ │ └── running │ │ │ │ │ ├── RunningNode.java │ │ │ │ │ └── RunningService.java │ │ │ └── statistics │ │ │ │ ├── StatisticManager.java │ │ │ │ ├── StatisticsScheduler.java │ │ │ │ ├── TaskResultMetaData.java │ │ │ │ ├── job │ │ │ │ ├── AbstractStatisticJob.java │ │ │ │ ├── JobRunningStatisticJob.java │ │ │ │ ├── RegisteredJobStatisticJob.java │ │ │ │ ├── StatisticJob.java │ │ │ │ └── TaskResultStatisticJob.java │ │ │ │ └── util │ │ │ │ └── StatisticTimeUtils.java │ │ │ └── security │ │ │ └── WwwAuthFilter.java │ └── resources │ │ ├── assembly │ │ └── assembly.xml │ │ ├── bin │ │ ├── dcos.sh │ │ └── start.sh │ │ ├── conf │ │ ├── auth.properties │ │ └── elastic-job-cloud-scheduler.properties │ │ ├── console │ │ ├── css │ │ │ └── common.css │ │ ├── favicon.ico │ │ ├── html │ │ │ ├── app │ │ │ │ ├── add_app.html │ │ │ │ ├── apps_overview.html │ │ │ │ ├── detail_app.html │ │ │ │ └── modify_app.html │ │ │ ├── history │ │ │ │ ├── job_dashboard.html │ │ │ │ ├── job_exec_details.html │ │ │ │ └── job_exec_status.html │ │ │ └── job │ │ │ │ ├── add_job.html │ │ │ │ ├── detail_job.html │ │ │ │ ├── job_status.html │ │ │ │ ├── jobs_overview.html │ │ │ │ └── modify_job.html │ │ ├── i18n │ │ │ ├── message.properties │ │ │ ├── message_en.properties │ │ │ └── message_zh.properties │ │ ├── index.html │ │ ├── js │ │ │ ├── app │ │ │ │ ├── add_app.js │ │ │ │ ├── app_common.js │ │ │ │ ├── apps_overview.js │ │ │ │ └── modify_app.js │ │ │ ├── common │ │ │ │ └── common.js │ │ │ ├── history │ │ │ │ ├── history_common.js │ │ │ │ ├── job_dashboard.js │ │ │ │ ├── job_exec_details.js │ │ │ │ └── job_exec_status.js │ │ │ ├── index.js │ │ │ └── job │ │ │ │ ├── add_job.js │ │ │ │ ├── job_common.js │ │ │ │ ├── jobs_overview.js │ │ │ │ └── modify_job.js │ │ └── lib │ │ │ ├── AdminLTE │ │ │ ├── css │ │ │ │ ├── AdminLTE.min.css │ │ │ │ └── skins │ │ │ │ │ └── _all-skins.min.css │ │ │ └── js │ │ │ │ └── app.min.js │ │ │ ├── BootstrapValidator │ │ │ └── js │ │ │ │ ├── bootstrapValidator.js │ │ │ │ └── bootstrapValidator_zh_CN.js │ │ │ ├── bootstrap-table │ │ │ ├── bootstrap-table-zh-CN.js │ │ │ ├── bootstrap-table.css │ │ │ ├── bootstrap-table.js │ │ │ ├── bootstrap-table.min.css │ │ │ └── bootstrap-table.min.js │ │ │ ├── bootstrap │ │ │ ├── css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ └── bootstrap.min.css │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── npm.js │ │ │ ├── daterangepicker │ │ │ ├── daterangepicker.css │ │ │ ├── daterangepicker.js │ │ │ ├── moment.js │ │ │ └── moment.min.js │ │ │ ├── font-awesome-4.5.0 │ │ │ ├── css │ │ │ │ ├── font-awesome.css │ │ │ │ └── font-awesome.min.css │ │ │ └── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.svg │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ └── fontawesome-webfont.woff2 │ │ │ ├── highcharts │ │ │ └── js │ │ │ │ └── highcharts.js │ │ │ ├── input-mask │ │ │ ├── jquery.inputmask.date.extensions.js │ │ │ ├── jquery.inputmask.extensions.js │ │ │ ├── jquery.inputmask.js │ │ │ ├── jquery.inputmask.numeric.extensions.js │ │ │ ├── jquery.inputmask.phone.extensions.js │ │ │ ├── jquery.inputmask.regex.extensions.js │ │ │ └── phone-codes │ │ │ │ ├── phone-be.json │ │ │ │ ├── phone-codes.json │ │ │ │ └── readme.txt │ │ │ └── jQuery │ │ │ ├── jQuery-2.1.4.min.js │ │ │ └── jquery.i18n.properties-min.js │ │ └── logback.xml │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── shardingsphere │ │ └── elasticjob │ │ └── cloud │ │ ├── AllTests.java │ │ ├── restful │ │ ├── AllRestfulTests.java │ │ ├── RestfulExceptionTest.java │ │ ├── RestfulServerTest.java │ │ └── fixture │ │ │ ├── Caller.java │ │ │ ├── TestFilter.java │ │ │ └── TestRestfulApi.java │ │ └── scheduler │ │ ├── AllCloudSchedulerTests.java │ │ ├── config │ │ ├── AllConfigTests.java │ │ ├── app │ │ │ ├── AllCloudAppConfigTests.java │ │ │ ├── CloudAppConfigurationNodeTest.java │ │ │ └── CloudAppConfigurationServiceTest.java │ │ └── job │ │ │ ├── AllCloudJobConfigTests.java │ │ │ ├── CloudJobConfigurationListenerTest.java │ │ │ ├── CloudJobConfigurationNodeTest.java │ │ │ └── CloudJobConfigurationServiceTest.java │ │ ├── context │ │ ├── AllContextTests.java │ │ └── JobContextTest.java │ │ ├── env │ │ ├── AllEnvTests.java │ │ └── BootstrapEnvironmentTest.java │ │ ├── fixture │ │ ├── CloudAppConfigurationBuilder.java │ │ ├── CloudAppJsonConstants.java │ │ ├── CloudJobConfigurationBuilder.java │ │ ├── CloudJsonConstants.java │ │ ├── EmbedTestingServer.java │ │ ├── TaskNode.java │ │ └── TestSimpleJob.java │ │ ├── ha │ │ ├── AllHATests.java │ │ └── FrameworkIDServiceTest.java │ │ ├── mesos │ │ ├── AllMesosTests.java │ │ ├── AppConstraintEvaluatorTest.java │ │ ├── FacadeServiceTest.java │ │ ├── JobTaskRequestTest.java │ │ ├── LaunchingTasksTest.java │ │ ├── LeasesQueueTest.java │ │ ├── MesosStateServiceTest.java │ │ ├── ReconcileServiceTest.java │ │ ├── SchedulerEngineTest.java │ │ ├── SchedulerServiceTest.java │ │ ├── SupportedExtractionTypeTest.java │ │ ├── TaskInfoDataTest.java │ │ ├── TaskLaunchScheduledServiceTest.java │ │ └── fixture │ │ │ ├── OfferBuilder.java │ │ │ ├── master │ │ │ └── MesosMasterServerMock.java │ │ │ └── slave │ │ │ └── MesosSlaveServerMock.java │ │ ├── producer │ │ ├── AllProducerTests.java │ │ ├── ProducerJobTest.java │ │ ├── ProducerManagerTest.java │ │ ├── TransientProducerRepositoryTest.java │ │ └── TransientProducerSchedulerTest.java │ │ ├── restful │ │ ├── AbstractCloudRestfulApiTest.java │ │ ├── AllRestfulTests.java │ │ ├── CloudAppRestfulApiTest.java │ │ ├── CloudJobRestfulApiTest.java │ │ ├── CloudOperationRestfulApiTest.java │ │ └── RestfulTestsUtil.java │ │ ├── state │ │ ├── AllStateTests.java │ │ ├── disable │ │ │ ├── app │ │ │ │ ├── DisableAppNodeTest.java │ │ │ │ └── DisableAppServiceTest.java │ │ │ └── job │ │ │ │ ├── DisableJobNodeTest.java │ │ │ │ └── DisableJobServiceTest.java │ │ ├── failover │ │ │ ├── FailoverNodeTest.java │ │ │ └── FailoverServiceTest.java │ │ ├── ready │ │ │ ├── ReadyNodeTest.java │ │ │ └── ReadyServiceTest.java │ │ └── running │ │ │ ├── RunningNodeTest.java │ │ │ └── RunningServiceTest.java │ │ └── statistics │ │ ├── AllStatisticTests.java │ │ ├── StatisticManagerTest.java │ │ ├── StatisticsSchedulerTest.java │ │ ├── TaskResultMetaDataTest.java │ │ ├── job │ │ ├── BaseStatisticJobTest.java │ │ ├── JobRunningStatisticJobTest.java │ │ ├── RegisteredJobStatisticJobTest.java │ │ ├── TaskResultStatisticJobTest.java │ │ └── TestStatisticJob.java │ │ └── util │ │ └── StatisticTimeUtilsTest.java │ └── resources │ └── logback-test.xml ├── examples ├── .gitignore ├── LICENSE ├── README.md ├── elastic-job-example-cloud │ ├── pom.xml │ └── src │ │ ├── README.txt │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── dangdang │ │ │ └── ddframe │ │ │ └── job │ │ │ └── example │ │ │ └── CloudJobMain.java │ │ └── resources │ │ ├── META-INF │ │ └── applicationContext.xml │ │ ├── assembly │ │ └── assembly.xml │ │ ├── bin │ │ └── start.sh │ │ ├── logback.xml │ │ └── script │ │ └── demo.sh ├── elastic-job-example-embed-zk │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── dangdang │ │ └── ddframe │ │ └── job │ │ └── example │ │ └── EmbedZookeeperServer.java ├── elastic-job-example-jobs │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── dangdang │ │ └── ddframe │ │ └── job │ │ └── example │ │ ├── fixture │ │ ├── entity │ │ │ └── Foo.java │ │ └── repository │ │ │ ├── FooRepository.java │ │ │ └── FooRepositoryFactory.java │ │ └── job │ │ ├── dataflow │ │ ├── JavaDataflowJob.java │ │ └── SpringDataflowJob.java │ │ └── simple │ │ ├── JavaSimpleJob.java │ │ └── SpringSimpleJob.java └── pom.xml ├── pom.xml └── src └── main └── resources ├── checkstyle.xml └── checkstyle_ci.xml /README.md: -------------------------------------------------------------------------------- 1 | Transfer to https://github.com/apache/shardingsphere-elasticjob 2 | -------------------------------------------------------------------------------- /elasticjob-cloud/.asf.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | notifications: 19 | commits: notifications@shardingsphere.apache.org 20 | issues: notifications@shardingsphere.apache.org 21 | pullrequests: notifications@shardingsphere.apache.org 22 | -------------------------------------------------------------------------------- /elasticjob-cloud/.gitignore: -------------------------------------------------------------------------------- 1 | # maven ignore 2 | target/ 3 | *.jar 4 | *.war 5 | *.zip 6 | *.tar 7 | 8 | # eclipse ignore 9 | .settings/ 10 | .project 11 | .classpath 12 | 13 | # idea ignore 14 | .idea/ 15 | *.ipr 16 | *.iml 17 | *.iws 18 | 19 | # temp ignore 20 | logs/ 21 | *.doc 22 | *.log 23 | *.cache 24 | *.diff 25 | *.patch 26 | *.tmp 27 | 28 | # system ignore 29 | .DS_Store 30 | Thumbs.db 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | dist: trusty 3 | jdk: 4 | - oraclejdk8 5 | #- oraclejdk7 6 | #- openjdk7 7 | before_script: 8 | - echo "MAVEN_OPTS='-Xmx1024m -XX:MaxPermSize=256m'" > ~/.mavenrc 9 | after_success: 10 | - mvn clean cobertura:cobertura coveralls:report 11 | -------------------------------------------------------------------------------- /elasticjob-cloud/ROADMAP.md: -------------------------------------------------------------------------------- 1 | # Roadmap 2 | 3 | - [x] Unified Job Config API 4 | - [x] Core Config 5 | - [x] Type Config 6 | - [x] Root Config 7 | - [x] Job Types 8 | - [x] Simple 9 | - [x] Dataflow 10 | - [x] Script 11 | - [ ] Http 12 | - [x] Event Trace 13 | - [x] Event Publisher 14 | - [x] Database Event Listener 15 | - [ ] Other Event Listener 16 | - [ ] Unified Schedule API 17 | - [ ] Unified Resource API 18 | - [x] Transient Job 19 | - [x] High Availability 20 | - [x] Elastic scale in/out 21 | - [x] Failover 22 | - [x] Misfire 23 | - [x] Idempotency 24 | - [x] Daemon Job 25 | - [x] High Availability 26 | - [x] Elastic scale in/out 27 | - [ ] Failover 28 | - [ ] Misfire 29 | - [x] Idempotency 30 | - [x] Mesos Scheduler 31 | - [x] High Availability 32 | - [x] Reconcile 33 | - [ ] Redis Based Queue Improvement 34 | - [ ] Http Driver 35 | - [x] Mesos Executor 36 | - [x] Executor Reuse Pool 37 | - [ ] Progress Reporting 38 | - [ ] Health Detection 39 | - [ ] Log Redirect 40 | - [x] Lifecycle Management 41 | - [x] Job Add/Remove 42 | - [ ] Job Pause/Resume 43 | - [x] Job Disable/Enable 44 | - [ ] Job Shutdown 45 | - [x] App Add/Remove 46 | - [x] App Disable/Enable 47 | - [x] Restful API 48 | - [x] Web Console 49 | - [ ] Job Dependency 50 | - [ ] Listener 51 | - [ ] Workflow 52 | - [ ] DAG 53 | - [x] Job Distribution 54 | - [x] Mesos Based Distribution 55 | - [ ] Docker Based Distribution 56 | - [x] Resources Management 57 | - [x] Resources Allocate 58 | - [ ] Cross Data Center 59 | - [ ] A/B Test 60 | - [x] Spring Integrate 61 | - [x] Bean Injection 62 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/README.md: -------------------------------------------------------------------------------- 1 | 本文档使用[hugo](http://gohugo.io/overview/introduction/)生成文档。 2 | 同时使用主题[hugo theme learn](https://github.com/matcornic/hugo-theme-learn)来作为文档风格。 -------------------------------------------------------------------------------- /elasticjob-cloud/docs/config.toml: -------------------------------------------------------------------------------- 1 | baseurl = "https://shardingsphere.apache.org/elasticjob/cloud" 2 | canonifyurls = true 3 | theme = "hugo-theme-learn" 4 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/content/01-start/faq.md: -------------------------------------------------------------------------------- 1 | +++ 2 | toc = true 3 | date = "2016-01-27T16:14:21+08:00" 4 | title = "FAQ" 5 | weight = 2 6 | prev = "/01-start/quick-start/" 7 | next = "/01-start/dev-guide/" 8 | +++ 9 | 10 | ### 1. 阅读源码时为什么会出现编译错误? 11 | 12 | 回答: 13 | 14 | Elastic-Job使用lombok实现极简代码。关于更多使用和安装细节,请参考[lombok官网](https://projectlombok.org/download.html)。 15 | 16 | *** 17 | 18 | ### 2. Elastic-Job-Cloud有何使用限制? 19 | 20 | 回答: 21 | 22 | * 作业启动成功后修改作业名称视为新作业,原作业废弃。 23 | 24 | *** 25 | 26 | ### 3. 是否支持动态添加作业? 27 | 28 | 回答: 29 | 30 | 动态添加作业这个概念每个人理解不尽相同。 31 | 32 | elastic-job-cloud为mesos框架,由mesos负责作业启动和分发。 33 | 但需要将作业打包上传,并调用elastic-job-cloud提供的REST API写入注册中心。 34 | 打包上传属于部署系统的范畴elastic-job-cloud并未涉及。 35 | 36 | elastic-job已做了基本动态添加功能,但无法做到真正意义的完全自动化添加。 37 | 38 | *** 39 | 40 | ### 4. 使用Spring版本有何限制? 41 | 42 | 回答: 43 | 44 | Elastic-Job的Spring版本支持从3.1.0.RELEASE至4的任何版本。Spring 5由于仅支持JDK 8及其以上版本,因此目前并不支持。Spring 3.1.0之前的版本对占位符的使用与目前不同,因此不再支持。Elastic-Job并未包含Spring的maven依赖,请自行添加您需要的版本。 45 | 46 | *** 47 | 48 | ### 5. Zookeeper版本不是3.4.6会有什么问题? 49 | 50 | 回答: 51 | 52 | 根据测试,使用3.3.6版本的Zookeeper在使用Curator 2.10.0的CuratorTransactionFinal的commit时会导致死锁。 53 | 54 | *** 55 | 56 | ### 6. Elastic-Job 2.0.5版本使用Cloud需要注意哪些问题? 57 | 58 | 回答: 59 | 60 | 对于Elastic Job Cloud,原作业维度配置无法满足易用性和扩展性等需求,因此在elastic-job 2.0.5Cloud版本中增加了作业APP的概念,即作业打包部署后的应用,描述了作业启动需要用到的CPU、内存、启动脚本及应用下载路径等基本信息,每个APP可以包含一个或多个作业。 61 | 62 | ### 7. 添加任务后为什么任务一直在ready状态,而不开始执行? 63 | 64 | 回答: 65 | 66 | 任务在mesos有单独的agent可提供所需的资源时才会启动,否则会等待直到有足够的资源。 67 | 68 | **增加JOB APP API** 69 | 70 | * 将作业打包部署后发布作业APP。 71 | 72 | * 作业APP配置参数cpuCount,memoryMB分别代表应用启动时需要用到的CPU及内存。 73 | 74 | **调整JOB API** 75 | 76 | * 新增作业时,必须先发布打包部署后的作业APP。 77 | 78 | * 作业配置参数cpuCount,memoryMB分别代表作业运行时需要用到的CPU及内存。 79 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/content/01-start/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | icon = "1. " 3 | date = "2016-12-02T16:06:17+08:00" 4 | title = "起航" 5 | weight = 0 6 | prev = "/00-overview/contribution/" 7 | next = "/01-start/quick-start/" 8 | chapter = true 9 | +++ 10 | 11 | # 本章导航 12 | 13 | - 如果想快速体验Elastic-Job-Cloud的强大功能,请阅读[快速入门](/01-start/quick-start)。 14 | - 如果在使用中遇到什么问题,请首先在[FAQ](/01-start/faq)中寻找解决问题的答案。 15 | - 想要在自己的项目中集成Elastic-Job-Cloud,您一定很关心它[如何开发](/01-start/dev-guide)及[如何部署](/01-start/deploy-guide)。 16 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/content/02-guide/cloud-concepts.md: -------------------------------------------------------------------------------- 1 | +++ 2 | toc = true 3 | date = "2017-02-20T10:38:50+08:00" 4 | title = "核心概念" 5 | weight = 1 6 | prev = "/02-guide" 7 | next = "/02-guide/cloud-web-console/" 8 | +++ 9 | 10 | 本文介绍Elastic-Job-Cloud包含的一些核心概念。 11 | 12 | ## Elastic-Job-Cloud-Scheduler 13 | Elastic-Job-Cloud-Scheduler表示基于Mesos的Framework,用于资源调度和应用分发,需要独立启动并提供服务。 14 | 15 | ## 作业APP 16 | 作业APP指作业打包部署后的应用,描述了作业启动需要用到的CPU、内存、启动脚本及应用下载路径等基本信息,每个APP可以包含一个或多个作业。 17 | 18 | ## 作业 19 | 作业即实际运行的具体任务,和Lite版本一样,包含Simple、Dataflow和Script共3种作业类型,在注册作业前必须先注册作业APP。 20 | 21 | ## 资源 22 | 资源指作业启动或运行需要用到的CPU、内存,配置在APP维度表示整个应用启动需要用的资源,配置在JOB维度表示每个作业运行需要的资源,JOB启动需要的资源为指定APP需要的资源与JOB需要资源的总和。 23 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/content/02-guide/cloud-web-console.md: -------------------------------------------------------------------------------- 1 | +++ 2 | toc = true 3 | date = "2017-01-07T16:14:21+08:00" 4 | title = "运维平台" 5 | weight = 11 6 | prev = "/02-guide/cloud-concepts/" 7 | next = "/02-guide/cloud-restful-api/" 8 | +++ 9 | 10 | 运维平台内嵌于elastic-job-cloud-scheduler的jar包中, 无需额外启动WEB付服务器, 可通过修改配置文件中http_port参数来调整启动端口,默认端口为8899,访问地址为http://{your_scheduler_ip}:8899。 11 | 12 | ## 登录 13 | 14 | 提供两种账户,管理员及访客,管理员拥有全部操作权限,访客仅拥有察看权限。默认管理员用户名和密码是root/root,访客用户名和密码是guest/guest,可通过conf\auth.properties修改管理员及访客用户名及密码。 15 | 16 | ## 功能列表 17 | 18 | * 作业APP管理(发布、修改、查看) 19 | 20 | * 作业管理(注册、修改、查看以及删除) 21 | 22 | * 作业状态查看(待运行、运行中、待失效转移) 23 | 24 | * 作业历史查看(运行轨迹、执行状态、历史dashboard) 25 | 26 | ## 设计理念 27 | 28 | 运维平台采用纯静态HTML+JS方式与后台的RESTful API交互,通过读取作业注册中心展示作业配置和状态,数据库展现作业运行轨迹及执行状态,或更新作业注册中心数据修改作业配置。 29 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/content/02-guide/high-availability.md: -------------------------------------------------------------------------------- 1 | +++ 2 | toc = true 3 | date = "2016-02-15T16:14:21+08:00" 4 | title = "高可用" 5 | weight = 20 6 | prev = "/02-guide/cloud-restful-api/" 7 | next = "/02-guide/event-trace/" 8 | +++ 9 | 10 | ## 介绍 11 | 12 | 调度器的高可用是通过运行几个指向同一个ZooKeeper集群的Elastic-Job-Cloud-Scheduler实例来实现的。ZooKeeper用于在当前主Elastic-Job-Cloud-Scheduler实例失败的情况下执行领导者选举。通过至少两个调度器实例来构成集群,集群中只有一个调度器实例提供服务,其他实例处于"待命"状态。当该实例失败时,集群会选举剩余实例中的一个来继续提供服务。 13 | 14 | ## 配置 15 | 16 | 每个Elastic-Job-Cloud-Scheduler实例必须使用相同的ZooKeeper集群。 17 | 例如,如果Zookeeper的Quorum为zk://1.2.3.4:2181,2.3.4.5:2181,3.4.5.6:2181/elastic-job-cloud,则elastic-job-cloud-scheduler.properties中Zookeeper相关配置为: 18 | 19 | ```properties 20 | # Elastic-Job-Cloud's zookeeper address 21 | zk_servers=1.2.3.4:2181,2.3.4.5:2181,3.4.5.6:2181 22 | 23 | # Elastic-Job-Cloud's zookeeper namespace 24 | zk_namespace=elastic-job-cloud 25 | ``` -------------------------------------------------------------------------------- /elasticjob-cloud/docs/content/02-guide/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | icon = "2. " 3 | date = "2016-12-12T16:06:17+08:00" 4 | title = "使用指南" 5 | weight = 0 6 | prev = "/01-start/deploy-guide/" 7 | next = "/02-guide/cloud-concepts/" 8 | chapter = true 9 | +++ 10 | 11 | # 本章导航 12 | 13 | - 想要了解Elastic-Job-Cloud是什么?请先了解这些[核心概念](/02-guide/cloud-concepts/) 14 | 15 | - Elastic-Job-Cloud提供了简单易用的[运维平台](/02-guide/cloud-web-console/),方便用户操作及查询作业。 16 | 17 | - [RESTful API](/02-guide/cloud-restful-api/)介绍了如何通过RESTful API操作应用及作业。 18 | 19 | - Elastic-Job-Cloud的Scheduler如何保证高可用?请阅读[高可用](/02-guide/high-availability/)。 20 | 21 | - 为了便于记录、查询、统计及监控作业运行情况,Elastic-Job提供了[事件追踪](/02-guide/event-trace/)功能。 22 | 23 | - 为了方便在开发机上调试,运行作业,Elastic-Job提供了[本地运行作业](/02-guide/local-executor)功能。 -------------------------------------------------------------------------------- /elasticjob-cloud/docs/content/02-guide/local-executor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | toc = true 3 | date = "2017-06-05T16:14:21+08:00" 4 | title = "本地运行模式" 5 | weight = 40 6 | prev = "/02-guide/event-trace/" 7 | next = "/03-design" 8 | +++ 9 | 10 | 在开发`Elastic-Job-Cloud`作业时,开发人员可以脱离`Mesos`环境,在本地运行和调试作业。可以利用本地运行模式充分的调试业务功能以及单元测试,完成之后再部署至`Mesos`集群。 11 | 12 | 本地运行作业无需安装`Mesos`环境。 13 | 14 | ## 配置 15 | 16 | 使用`org.apache.shardingsphere.elasticjob.cloud.executor.local.LocalCloudJobConfiguration`配置本地作业。 17 | 18 | ```java 19 | LocalCloudJobConfiguration config = new LocalCloudJobConfiguration( 20 | new SimpleJobConfiguration(JobCoreConfiguration.newBuilder("FooJob", "*/2 * * * * ?", 3) //1 21 | .shardingItemParameters("0=Beijing,1=Shanghai,2=Guangzhou") 22 | .jobParameter("dbName=dangdang").build(), "com.xxx.foo.FooJob"), 23 | 1, //2 24 | "testSimpleJob" , "applicationContext.xml"); //3 25 | ``` 26 | 27 | 1. 配置作业类型和作业基本信息。 28 | 1. 配置当前运行的作业是第几个分片。 29 | 1. 配置Spring相关参数。 30 | 31 | ## 运行 32 | 33 | 使用`org.apache.shardingsphere.elasticjob.cloud.executor.local.LocalTaskExecutor`运行作业。 34 | 35 | ```java 36 | new LocalTaskExecutor(localJobConfig).execute(); 37 | ``` 38 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/content/03-design/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | icon = "3. " 3 | date = "2016-12-12T16:06:17+08:00" 4 | title = "设计规划" 5 | weight = 0 6 | prev = "/02-guide/event-trace/" 7 | next = "/03-design/module/" 8 | chapter = true 9 | +++ 10 | 11 | # 本章导航 12 | 13 | - 想了解模块设计,请阅读[目录结构说明](/03-design/module/)。 14 | 15 | - Elastic-Job-Cloud未来规划有哪些呢?请阅读[未来规划](/03-design/roadmap/)。 -------------------------------------------------------------------------------- /elasticjob-cloud/docs/content/03-design/module.md: -------------------------------------------------------------------------------- 1 | +++ 2 | toc = true 3 | date = "2016-12-06T22:38:50+08:00" 4 | title = "目录结构说明" 5 | weight = 2 6 | prev = "/03-design" 7 | next = "/03-design/roadmap/" 8 | +++ 9 | 10 | ``` 11 | elastic-job 12 | ├──elastic-job-cloud cloud父模块,不应直接使用 13 | ├ ├──elastic-job-cloud-executor 执行器模块,开发作业时需依赖该模块,可直接使用 14 | ├ ├──elastic-job-cloud-scheduler 调度器模块,可直接使用 15 | ├──elastic-job-example 使用示例 16 | ├ ├──elastic-job-example-embed-zk 供示例使用的内嵌ZK模块 17 | ├ ├──elastic-job-example-jobs 作业示例 18 | ├ ├──elastic-job-example-cloud 基于Spring的使用示例 19 | ├──elastic-job-doc markdown生成文档的项目,使用方无需关注 20 | ├ ├──elastic-job-cloud-doc cloud相关文档 21 | ``` 22 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/layouts/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Index 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/layouts/partials/logo.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/layouts/partials/script.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/layouts/partials/style.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/static/css/style.css: -------------------------------------------------------------------------------- 1 | /* background behind the logo*/ 2 | #header { 3 | background: black; 4 | border-color: black; 5 | } 6 | 7 | #header-wrapper { 8 | background: black; 9 | border-color: black; 10 | } 11 | 12 | #chapter p { 13 | text-align: left; 14 | } 15 | 16 | .copy-to-clipboard { 17 | background-image: none; 18 | display: none; 19 | } 20 | 21 | #body img, #body .video-container { 22 | margin: auto; 23 | text-align: left; 24 | display: inherit; 25 | } 26 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/static/dist/elastic-job-cloud-scheduler-2.1.2.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/static/dist/elastic-job-cloud-scheduler-2.1.2.tar.gz -------------------------------------------------------------------------------- /elasticjob-cloud/docs/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /elasticjob-cloud/docs/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /elasticjob-cloud/docs/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /elasticjob-cloud/docs/static/img/architecture/elastic_job_cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/static/img/architecture/elastic_job_cloud.png -------------------------------------------------------------------------------- /elasticjob-cloud/docs/static/img/elastic-job.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/static/img/elastic-job.png -------------------------------------------------------------------------------- /elasticjob-cloud/docs/static/img/license.svg: -------------------------------------------------------------------------------- 1 | licenselicenseApache 2Apache 2 -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Grav 4 | Copyright (c) 2016 MATHIEU CORNIC 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/archetypes/chapter.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Some Chapter title" 3 | weight: 0 4 | icon: "X. " # HTML code as prefix in the menu 5 | --- 6 | 7 | ### Chapter X 8 | 9 | # Some Chapter title 10 | 11 | Lorem ipsum 12 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Some Title" 3 | weight: 5 4 | toc: true 5 | --- 6 | 7 | Lorem Ipsum 8 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{ if .Content }} 2 | {{ partial "header.html" . }} 3 | {{ .Content }} 4 | {{ partial "footer.html" . }} 5 | {{ else }} 6 | {{ with (index (index .Site.Sections .Section) 0) }} 7 | {{ with .Page }} 8 | {{ partial "header.html" . }} 9 | {{ .Content }} 10 | {{ partial "footer.html" . }} 11 | {{ end }} 12 | {{ end }} 13 | {{ end }} 14 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ partial "header.html" . }} 2 | {{ .Content }} 3 | {{ partial "footer.html" . }} 4 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/layouts/partials/favicon.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/layouts/partials/meta.html: -------------------------------------------------------------------------------- 1 | 2 | {{ with .Site.Params.author }}{{ end }} 3 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/layouts/partials/script.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/layouts/partials/style.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/layouts/partials/toc.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ .TableOfContents }} 4 |
5 |
6 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/layouts/shortcodes/button.html: -------------------------------------------------------------------------------- 1 | 2 | {{ $icon := .Get "icon" }} 3 | {{ $iconposition := .Get "icon-position" }} 4 | {{ if ($icon) }} 5 | {{ if or (not ($iconposition)) (eq $iconposition "left") }} 6 | 7 | {{ end }} 8 | {{ end }} 9 | {{ .Inner }} 10 | {{ if and ($icon) (eq $iconposition "right")}} 11 | 12 | {{ end }} 13 | 14 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/layouts/shortcodes/notice.html: -------------------------------------------------------------------------------- 1 |
{{ .Inner }}
2 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/css/featherlight.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Featherlight - ultra slim jQuery lightbox 3 | * Version 1.2.3 - http://noelboss.github.io/featherlight/ 4 | * 5 | * Copyright 2015, Noël Raoul Bossart (http://www.noelboss.com) 6 | * MIT Licensed. 7 | **/ 8 | @media all{.featherlight{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2147483647;text-align:center;white-space:nowrap;cursor:pointer;background:#333;background:rgba(0,0,0,0)}.featherlight:last-of-type{background:rgba(0,0,0,.8)}.featherlight:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.featherlight .featherlight-content{position:relative;text-align:left;vertical-align:middle;display:inline-block;overflow:auto;padding:25px 25px 0;border-bottom:25px solid transparent;min-width:30%;margin-left:5%;margin-right:5%;max-height:95%;background:#fff;cursor:auto;white-space:normal}.featherlight .featherlight-inner{display:block}.featherlight .featherlight-close-icon{position:absolute;z-index:9999;top:0;right:0;line-height:25px;width:25px;cursor:pointer;text-align:center;font:Arial,sans-serif;background:#fff;background:rgba(255,255,255,.3);color:#000}.featherlight .featherlight-image{width:100%}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0}.featherlight iframe{border:0}}@media only screen and (max-width:1024px){.featherlight .featherlight-content{margin-left:10px;margin-right:10px;max-height:98%;padding:10px 10px 0;border-bottom:10px solid transparent}} -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/css/horsey.css: -------------------------------------------------------------------------------- 1 | .sey-list { 2 | display: none; 3 | position: absolute; 4 | padding: 0; 5 | margin: 0; 6 | list-style-type: none; 7 | box-shadow: 1px 2px 6px; 8 | background-color: #fff; 9 | color: #333; 10 | transition: left 0.1s ease-in-out; 11 | max-height: 70vh; 12 | overflow: auto; 13 | width: 265px; 14 | } 15 | .sey-show { 16 | display: block; 17 | } 18 | .sey-hide { 19 | display: none; 20 | } 21 | .sey-item { 22 | cursor: pointer; 23 | overflow: hidden; 24 | white-space: nowrap; 25 | text-overflow: ellipsis; 26 | padding: 7px; 27 | } 28 | .sey-item:hover { 29 | background-color: #444; 30 | color: #fff; 31 | } 32 | .sey-selected { 33 | background-color: #333; 34 | color: #fff; 35 | } 36 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Inconsolata.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Inconsolata.eot -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Inconsolata.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Inconsolata.ttf -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Inconsolata.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Inconsolata.woff -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.eot -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.ttf -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.woff -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.woff2 -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.eot -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.ttf -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.woff -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.woff2 -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_200.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_200.eot -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_200.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_200.ttf -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_200.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_200.woff -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_200.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_200.woff2 -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_300.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_300.eot -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_300.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_300.ttf -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_300.woff -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_300.woff2 -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_500.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_500.eot -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_500.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_500.ttf -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_500.woff -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/Work_Sans_500.woff2 -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/images/clippy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/images/favicon.png -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/images/gopher-404.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/docs/themes/hugo-theme-learn/static/images/gopher-404.jpg -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/static/json/search.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /elasticjob-cloud/docs/themes/hugo-theme-learn/theme.toml: -------------------------------------------------------------------------------- 1 | # theme.toml template for a Hugo theme 2 | # See https://github.com/spf13/hugoThemes#themetoml for an example 3 | 4 | name = "Learn" 5 | license = "MIT" 6 | licenselink = "https://github.com/matcornic/hugo-theme-learn/blob/master/LICENSE.md" 7 | description = "Documentation theme for Hugo, based on Grav Learn theme" 8 | homepage = "https://matcornic.github.io/hugo-learn-doc/basics/what-is-this-hugo-theme/" 9 | tags = ["documentation", "grav", "learn", "doc"] 10 | features = ["documentation"] 11 | min_version = 0.19 12 | 13 | [author] 14 | name = "Mathieu Cornic" 15 | homepage = "http://matcornic.github.io/" 16 | 17 | [original] 18 | name = "Grav Learn" 19 | homepage = "http://learn.getgrav.org/" 20 | repo = "https://github.com/getgrav/grav-learn" 21 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/ElasticJob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.api; 19 | 20 | /** 21 | * ElasticJob interface. 22 | */ 23 | public interface ElasticJob { 24 | } 25 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/JobType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.api; 19 | 20 | /** 21 | * Job type. 22 | */ 23 | public enum JobType { 24 | 25 | SIMPLE, DATAFLOW, SCRIPT 26 | } 27 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/script/ScriptJob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.api.script; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.api.ElasticJob; 21 | 22 | /** 23 | * Script job. 24 | */ 25 | public interface ScriptJob extends ElasticJob { 26 | } 27 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/simple/SimpleJob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.api.simple; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.api.ElasticJob; 21 | import org.apache.shardingsphere.elasticjob.cloud.api.ShardingContext; 22 | 23 | /** 24 | * Simple job. 25 | */ 26 | public interface SimpleJob extends ElasticJob { 27 | 28 | /** 29 | * Execute job. 30 | * 31 | * @param shardingContext sharding context 32 | */ 33 | void execute(ShardingContext shardingContext); 34 | } 35 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/JobRootConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.config; 19 | 20 | /** 21 | * Job root configuration. 22 | */ 23 | public interface JobRootConfiguration { 24 | 25 | /** 26 | * Get type Configuration. 27 | * 28 | * @return Job type configuration 29 | */ 30 | JobTypeConfiguration getTypeConfig(); 31 | } 32 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/JobTypeConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.config; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.api.JobType; 21 | 22 | /** 23 | * Job type configuration. 24 | */ 25 | public interface JobTypeConfiguration { 26 | 27 | /** 28 | * Get job type. 29 | * 30 | * @return job type 31 | */ 32 | JobType getJobType(); 33 | 34 | /** 35 | * Get job class name. 36 | * 37 | * @return job class name 38 | */ 39 | String getJobClass(); 40 | 41 | /** 42 | * Get job core configuration. 43 | * 44 | * @return job core configuration 45 | */ 46 | JobCoreConfiguration getCoreConfig(); 47 | } 48 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/simple/SimpleJobConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.config.simple; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.api.JobType; 21 | import org.apache.shardingsphere.elasticjob.cloud.config.JobCoreConfiguration; 22 | import org.apache.shardingsphere.elasticjob.cloud.config.JobTypeConfiguration; 23 | import lombok.Getter; 24 | import lombok.RequiredArgsConstructor; 25 | 26 | /** 27 | * Simple job configuration. 28 | */ 29 | @RequiredArgsConstructor 30 | @Getter 31 | public final class SimpleJobConfiguration implements JobTypeConfiguration { 32 | 33 | private final JobCoreConfiguration coreConfig; 34 | 35 | private final JobType jobType = JobType.SIMPLE; 36 | 37 | private final String jobClass; 38 | } 39 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/context/ExecutionType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.context; 19 | 20 | /** 21 | * Execution type. 22 | */ 23 | public enum ExecutionType { 24 | 25 | /** 26 | * Ready of execute. 27 | */ 28 | READY, 29 | 30 | /** 31 | * Failover execution. 32 | */ 33 | FAILOVER 34 | } 35 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.event; 19 | 20 | /** 21 | * Job event. 22 | */ 23 | public interface JobEvent { 24 | 25 | /** 26 | * Get job name. 27 | * 28 | * @return job name 29 | */ 30 | String getJobName(); 31 | } 32 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.event; 19 | 20 | /** 21 | * Job event configuration. 22 | */ 23 | public interface JobEventConfiguration extends JobEventIdentity { 24 | 25 | /** 26 | * Create job event listener. 27 | * 28 | * @return Job event listener 29 | * @throws JobEventListenerConfigurationException job event listener configuration exception 30 | */ 31 | JobEventListener createJobEventListener() throws JobEventListenerConfigurationException; 32 | } 33 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventIdentity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.event; 19 | 20 | /** 21 | * Job event identity. 22 | */ 23 | public interface JobEventIdentity { 24 | 25 | /** 26 | * Get identity. 27 | * 28 | * @return identity 29 | */ 30 | String getIdentity(); 31 | } 32 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventListenerConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.event; 19 | 20 | /** 21 | * Job event listener configuration exception. 22 | */ 23 | public final class JobEventListenerConfigurationException extends Exception { 24 | 25 | private static final long serialVersionUID = 4069519372148227761L; 26 | 27 | public JobEventListenerConfigurationException(final Exception ex) { 28 | super(ex); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbIdentity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.event.rdb; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.event.JobEventIdentity; 21 | 22 | /** 23 | * Job event RDB identity. 24 | */ 25 | public class JobEventRdbIdentity implements JobEventIdentity { 26 | 27 | @Override 28 | public String getIdentity() { 29 | return "rdb"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/type/JobExecutionEventThrowable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.event.type; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Getter; 22 | import lombok.RequiredArgsConstructor; 23 | import lombok.ToString; 24 | 25 | /** 26 | * Job execution event throwable. 27 | */ 28 | @RequiredArgsConstructor 29 | @AllArgsConstructor 30 | @Getter 31 | @ToString(of = "plainText") 32 | public final class JobExecutionEventThrowable { 33 | 34 | private final Throwable throwable; 35 | 36 | private String plainText; 37 | } 38 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/AppConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.exception; 19 | 20 | /** 21 | * Application configuration exception. 22 | */ 23 | public final class AppConfigurationException extends RuntimeException { 24 | 25 | private static final long serialVersionUID = -1466479389299512371L; 26 | 27 | public AppConfigurationException(final String errorMessage, final Object... args) { 28 | super(String.format(errorMessage, args)); 29 | } 30 | 31 | public AppConfigurationException(final Throwable cause) { 32 | super(cause); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.exception; 19 | 20 | /** 21 | * Job configuration exception. 22 | */ 23 | public final class JobConfigurationException extends RuntimeException { 24 | 25 | private static final long serialVersionUID = 3244988974343209468L; 26 | 27 | public JobConfigurationException(final String errorMessage, final Object... args) { 28 | super(String.format(errorMessage, args)); 29 | } 30 | 31 | public JobConfigurationException(final Throwable cause) { 32 | super(cause); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobExecutionEnvironmentException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.exception; 19 | 20 | /** 21 | * Job execution environment exception. 22 | */ 23 | public final class JobExecutionEnvironmentException extends Exception { 24 | 25 | private static final long serialVersionUID = -6670738108926897433L; 26 | 27 | public JobExecutionEnvironmentException(final String errorMessage, final Object... args) { 28 | super(String.format(errorMessage, args)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobStatisticException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.exception; 19 | 20 | /** 21 | * Job statistic exception. 22 | */ 23 | public final class JobStatisticException extends RuntimeException { 24 | 25 | private static final long serialVersionUID = -2502533914008085601L; 26 | 27 | public JobStatisticException(final Exception ex) { 28 | super(ex); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobSystemException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.exception; 19 | 20 | /** 21 | * Job system exception. 22 | */ 23 | public final class JobSystemException extends RuntimeException { 24 | 25 | private static final long serialVersionUID = 5018901344199973515L; 26 | 27 | public JobSystemException(final String errorMessage, final Object... args) { 28 | super(String.format(errorMessage, args)); 29 | } 30 | 31 | public JobSystemException(final Throwable cause) { 32 | super(cause); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/handler/ExecutorServiceHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.executor.handler; 19 | 20 | import java.util.concurrent.ExecutorService; 21 | 22 | /** 23 | * Executor service handler. 24 | */ 25 | public interface ExecutorServiceHandler { 26 | 27 | /** 28 | * Create executor service. 29 | * 30 | * @param jobName job name 31 | * 32 | * @return executor service 33 | */ 34 | ExecutorService createExecutorService(String jobName); 35 | } 36 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/handler/JobExceptionHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.executor.handler; 19 | 20 | /** 21 | * Job exception handler. 22 | */ 23 | public interface JobExceptionHandler { 24 | 25 | /** 26 | * Handle exception. 27 | * 28 | * @param jobName job name 29 | * @param cause cause 30 | */ 31 | void handleException(String jobName, Throwable cause); 32 | } 33 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/handler/impl/DefaultExecutorServiceHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.executor.handler.impl; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.util.concurrent.ExecutorServiceObject; 21 | import org.apache.shardingsphere.elasticjob.cloud.executor.handler.ExecutorServiceHandler; 22 | 23 | import java.util.concurrent.ExecutorService; 24 | 25 | /** 26 | * Default executor service handler. 27 | */ 28 | public final class DefaultExecutorServiceHandler implements ExecutorServiceHandler { 29 | 30 | @Override 31 | public ExecutorService createExecutorService(final String jobName) { 32 | return new ExecutorServiceObject("inner-job-" + jobName, Runtime.getRuntime().availableProcessors() * 2).createExecutorService(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/handler/impl/DefaultJobExceptionHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.executor.handler.impl; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.executor.handler.JobExceptionHandler; 21 | import lombok.extern.slf4j.Slf4j; 22 | 23 | /** 24 | * Default job exception handler. 25 | */ 26 | @Slf4j 27 | public final class DefaultJobExceptionHandler implements JobExceptionHandler { 28 | 29 | @Override 30 | public void handleException(final String jobName, final Throwable cause) { 31 | log.error(String.format("Job '%s' exception occur in job processing", jobName), cause); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/reg/base/ElectionCandidate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.reg.base; 19 | 20 | /** 21 | * Election candidate. 22 | * 23 | *

24 | * Guarantee {@link #startLeadership()} and {@link #stopLeadership()} method run in same thread. 25 | *

26 | */ 27 | public interface ElectionCandidate { 28 | 29 | /** 30 | * Start leadership. 31 | * 32 | * @throws Exception exception 33 | */ 34 | void startLeadership() throws Exception; 35 | 36 | /** 37 | * Stop leadership. 38 | * 39 | *

Should not throw any exception for the implementation class.

40 | */ 41 | void stopLeadership(); 42 | } 43 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/reg/exception/RegException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.reg.exception; 19 | 20 | /** 21 | * Registry center exception. 22 | */ 23 | public final class RegException extends RuntimeException { 24 | 25 | private static final long serialVersionUID = -6417179023552012152L; 26 | 27 | public RegException(final String errorMessage, final Object... args) { 28 | super(String.format(errorMessage, args)); 29 | } 30 | 31 | public RegException(final Exception cause) { 32 | super(cause); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/StatisticInterval.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.statistics; 19 | 20 | import lombok.Getter; 21 | import lombok.RequiredArgsConstructor; 22 | 23 | /** 24 | * Task running statistics. 25 | */ 26 | @Getter 27 | @RequiredArgsConstructor 28 | public enum StatisticInterval { 29 | 30 | MINUTE("0 * * * * ?"), 31 | 32 | HOUR("0 0 * * * ?"), 33 | 34 | DAY("0 0 0 * * ?"); 35 | 36 | private final String cron; 37 | } 38 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobExecutionTypeStatistics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.statistics.type.job; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Getter; 22 | 23 | /** 24 | * Job execution type statistics. 25 | */ 26 | @Getter 27 | @AllArgsConstructor 28 | public final class JobExecutionTypeStatistics { 29 | 30 | private int transientJobCount; 31 | 32 | private int daemonJobCount; 33 | } 34 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobRegisterStatistics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.statistics.type.job; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Getter; 22 | import lombok.RequiredArgsConstructor; 23 | 24 | import java.util.Date; 25 | 26 | /** 27 | * Job register statistics. 28 | */ 29 | @Getter 30 | @RequiredArgsConstructor 31 | @AllArgsConstructor 32 | public final class JobRegisterStatistics { 33 | 34 | private long id; 35 | 36 | private final int registeredCount; 37 | 38 | private final Date statisticsTime; 39 | 40 | private Date creationTime = new Date(); 41 | } 42 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobRunningStatistics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.statistics.type.job; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Getter; 22 | import lombok.RequiredArgsConstructor; 23 | 24 | import java.util.Date; 25 | 26 | /** 27 | * Job running statistics. 28 | */ 29 | @Getter 30 | @RequiredArgsConstructor 31 | @AllArgsConstructor 32 | public final class JobRunningStatistics { 33 | 34 | private long id; 35 | 36 | private final int runningCount; 37 | 38 | private final Date statisticsTime; 39 | 40 | private Date creationTime = new Date(); 41 | } 42 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobTypeStatistics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.statistics.type.job; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Getter; 22 | 23 | /** 24 | * Job type statistics. 25 | */ 26 | @Getter 27 | @AllArgsConstructor 28 | public final class JobTypeStatistics { 29 | 30 | private int scriptJobCount; 31 | 32 | private int simpleJobCount; 33 | 34 | private int dataflowJobCount; 35 | } 36 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/task/TaskResultStatistics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.statistics.type.task; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; 21 | import lombok.AllArgsConstructor; 22 | import lombok.Getter; 23 | import lombok.RequiredArgsConstructor; 24 | 25 | import java.util.Date; 26 | 27 | /** 28 | * Task result statistics. 29 | */ 30 | @Getter 31 | @AllArgsConstructor 32 | @RequiredArgsConstructor 33 | public final class TaskResultStatistics { 34 | 35 | private long id; 36 | 37 | private final int successCount; 38 | 39 | private final int failedCount; 40 | 41 | private final StatisticInterval statisticInterval; 42 | 43 | private final Date statisticsTime; 44 | 45 | private Date creationTime = new Date(); 46 | } 47 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/task/TaskRunningStatistics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.statistics.type.task; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Getter; 22 | import lombok.RequiredArgsConstructor; 23 | 24 | import java.util.Date; 25 | 26 | /** 27 | * Task running statistics. 28 | */ 29 | @Getter 30 | @RequiredArgsConstructor 31 | @AllArgsConstructor 32 | public final class TaskRunningStatistics { 33 | 34 | private long id; 35 | 36 | private final int runningCount; 37 | 38 | private final Date statisticsTime; 39 | 40 | private Date creationTime = new Date(); 41 | } 42 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/concurrent/BlockUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.util.concurrent; 19 | 20 | import lombok.AccessLevel; 21 | import lombok.NoArgsConstructor; 22 | 23 | @NoArgsConstructor(access = AccessLevel.PRIVATE) 24 | public final class BlockUtils { 25 | 26 | /** 27 | * Wait for short time. 28 | */ 29 | public static void waitingShortTime() { 30 | sleep(100L); 31 | } 32 | 33 | /** 34 | * Sleep for millis. 35 | * @param millis the time for sleep 36 | */ 37 | public static void sleep(final long millis) { 38 | try { 39 | Thread.sleep(millis); 40 | } catch (final InterruptedException ex) { 41 | Thread.currentThread().interrupt(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/env/HostException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.util.env; 19 | 20 | import java.io.IOException; 21 | 22 | /** 23 | * Host exception. 24 | */ 25 | public final class HostException extends RuntimeException { 26 | 27 | private static final long serialVersionUID = 3589264847881174997L; 28 | 29 | public HostException(final IOException cause) { 30 | super(cause); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/env/TimeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.util.env; 19 | 20 | /** 21 | * Time service. 22 | */ 23 | public final class TimeService { 24 | 25 | /** 26 | * Get current millis. 27 | * 28 | * @return current millis 29 | */ 30 | public long getCurrentMillis() { 31 | return System.currentTimeMillis(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/api/AllApiTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.api; 19 | 20 | import org.junit.runner.RunWith; 21 | import org.junit.runners.Suite; 22 | import org.junit.runners.Suite.SuiteClasses; 23 | 24 | @RunWith(Suite.class) 25 | @SuiteClasses(ShardingContextTest.class) 26 | public final class AllApiTests { 27 | } 28 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/AllConfigTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.config; 19 | 20 | import org.junit.runner.RunWith; 21 | import org.junit.runners.Suite; 22 | import org.junit.runners.Suite.SuiteClasses; 23 | 24 | @RunWith(Suite.class) 25 | @SuiteClasses(JobCoreConfigurationTest.class) 26 | public final class AllConfigTests { 27 | } 28 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/context/AllContextTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.context; 19 | 20 | import org.junit.runner.RunWith; 21 | import org.junit.runners.Suite; 22 | 23 | @RunWith(Suite.class) 24 | @Suite.SuiteClasses(TaskContextTest.class) 25 | public final class AllContextTests { 26 | } 27 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/JobEventCaller.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.event.fixture; 19 | 20 | public interface JobEventCaller { 21 | 22 | /** 23 | * Call method. 24 | */ 25 | void call(); 26 | } 27 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/TestJobEventFailureConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.event.fixture; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.event.JobEventConfiguration; 21 | import org.apache.shardingsphere.elasticjob.cloud.event.JobEventListener; 22 | import org.apache.shardingsphere.elasticjob.cloud.event.JobEventListenerConfigurationException; 23 | 24 | public final class TestJobEventFailureConfiguration extends TestJobEventIdentity implements JobEventConfiguration { 25 | 26 | @Override 27 | public JobEventListener createJobEventListener() throws JobEventListenerConfigurationException { 28 | throw new JobEventListenerConfigurationException(new RuntimeException("assert failure")); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/TestJobEventIdentity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.event.fixture; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.event.JobEventIdentity; 21 | 22 | public class TestJobEventIdentity implements JobEventIdentity { 23 | 24 | @Override 25 | public String getIdentity() { 26 | return "test"; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbIdentityTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.event.rdb; 19 | 20 | import org.hamcrest.core.Is; 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public final class JobEventRdbIdentityTest { 25 | 26 | @Test 27 | public void assertGetIdentity() { 28 | Assert.assertThat(new JobEventRdbIdentity().getIdentity(), Is.is("rdb")); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/AllExceptionTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.exception; 19 | 20 | import org.junit.runner.RunWith; 21 | import org.junit.runners.Suite; 22 | import org.junit.runners.Suite.SuiteClasses; 23 | 24 | @RunWith(Suite.class) 25 | @SuiteClasses({ 26 | JobConfigurationExceptionTest.class, 27 | JobExecutionEnvironmentExceptionTest.class, 28 | JobSystemExceptionTest.class, 29 | ExceptionUtilTest.class, 30 | JobStatisticExceptionTest.class 31 | }) 32 | public final class AllExceptionTests { 33 | } 34 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/ExceptionUtilTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.exception; 19 | 20 | import org.hamcrest.core.Is; 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public final class ExceptionUtilTest { 25 | 26 | @Test 27 | public void assertTransformWithError() { 28 | Assert.assertTrue(ExceptionUtil.transform(new Error("Error")).startsWith("java.lang.Error")); 29 | } 30 | 31 | @Test 32 | public void assertTransformWithException() { 33 | Assert.assertTrue(ExceptionUtil.transform(new Exception("Exception")).startsWith("java.lang.Exception")); 34 | } 35 | 36 | @Test 37 | public void assertTransformWithNull() { 38 | Assert.assertThat(ExceptionUtil.transform(null), Is.is("")); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobConfigurationExceptionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.exception; 19 | 20 | import org.hamcrest.CoreMatchers; 21 | import org.hamcrest.core.Is; 22 | import org.junit.Assert; 23 | import org.junit.Test; 24 | 25 | public final class JobConfigurationExceptionTest { 26 | 27 | @Test 28 | public void assertGetMessage() { 29 | Assert.assertThat(new JobConfigurationException("message is: '%s'", "test").getMessage(), Is.is("message is: 'test'")); 30 | } 31 | 32 | @Test 33 | public void assertGetCause() { 34 | Assert.assertThat(new JobConfigurationException(new RuntimeException()).getCause(), CoreMatchers.instanceOf(RuntimeException.class)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobExecutionEnvironmentExceptionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.exception; 19 | 20 | import org.hamcrest.core.Is; 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public final class JobExecutionEnvironmentExceptionTest { 25 | 26 | @Test 27 | public void assertGetMessage() { 28 | Assert.assertThat(new JobExecutionEnvironmentException("message is: '%s'", "test").getMessage(), Is.is("message is: 'test'")); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobStatisticExceptionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.exception; 19 | 20 | import org.junit.Test; 21 | 22 | import static org.hamcrest.CoreMatchers.instanceOf; 23 | import static org.junit.Assert.assertThat; 24 | 25 | public class JobStatisticExceptionTest { 26 | 27 | @Test 28 | public void assertGetCause() { 29 | assertThat(new JobStatisticException(new RuntimeException()).getCause(), instanceOf(RuntimeException.class)); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobSystemExceptionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.exception; 19 | 20 | import org.hamcrest.CoreMatchers; 21 | import org.hamcrest.core.Is; 22 | import org.junit.Assert; 23 | import org.junit.Test; 24 | 25 | public final class JobSystemExceptionTest { 26 | 27 | @Test 28 | public void assertGetMessage() { 29 | Assert.assertThat(new JobSystemException("message is: '%s'", "test").getMessage(), Is.is("message is: 'test'")); 30 | } 31 | 32 | @Test 33 | public void assertGetCause() { 34 | Assert.assertThat(new JobSystemException(new RuntimeException()).getCause(), CoreMatchers.instanceOf(RuntimeException.class)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/fixture/config/TestJobRootConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.fixture.config; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.config.JobTypeConfiguration; 21 | import org.apache.shardingsphere.elasticjob.cloud.config.JobRootConfiguration; 22 | import lombok.RequiredArgsConstructor; 23 | 24 | @RequiredArgsConstructor 25 | public final class TestJobRootConfiguration implements JobRootConfiguration { 26 | 27 | private final JobTypeConfiguration typeConfig; 28 | 29 | @Override 30 | public JobTypeConfiguration getTypeConfig() { 31 | return typeConfig; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/fixture/handler/IgnoreJobExceptionHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.fixture.handler; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.executor.handler.JobExceptionHandler; 21 | 22 | public final class IgnoreJobExceptionHandler implements JobExceptionHandler { 23 | 24 | @Override 25 | public void handleException(final String jobName, final Throwable cause) { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/fixture/handler/ThrowJobExceptionHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.fixture.handler; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.executor.handler.JobExceptionHandler; 21 | import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException; 22 | 23 | public final class ThrowJobExceptionHandler implements JobExceptionHandler { 24 | 25 | @Override 26 | public void handleException(final String jobName, final Throwable cause) { 27 | throw new JobSystemException(cause); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/fixture/job/JobCaller.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.fixture.job; 19 | 20 | import java.util.List; 21 | 22 | public interface JobCaller { 23 | 24 | /** 25 | * Execute the job. 26 | */ 27 | void execute(); 28 | 29 | /** 30 | * Fetch job data. 31 | * @param shardingItem shard item 32 | * @return the job data 33 | */ 34 | List fetchData(int shardingItem); 35 | 36 | /** 37 | * Process job data. 38 | * @param data the job to process 39 | */ 40 | void processData(Object data); 41 | } 42 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/fixture/job/OtherJob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.fixture.job; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.api.ElasticJob; 21 | 22 | public final class OtherJob implements ElasticJob { 23 | } 24 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/fixture/job/TestSimpleJob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.fixture.job; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.api.ShardingContext; 21 | import org.apache.shardingsphere.elasticjob.cloud.api.simple.SimpleJob; 22 | import lombok.RequiredArgsConstructor; 23 | 24 | @RequiredArgsConstructor 25 | public final class TestSimpleJob implements SimpleJob { 26 | 27 | private final JobCaller jobCaller; 28 | 29 | @Override 30 | public void execute(final ShardingContext shardingContext) { 31 | jobCaller.execute(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/fixture/job/TestWrongJob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.fixture.job; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.api.ShardingContext; 21 | import org.apache.shardingsphere.elasticjob.cloud.api.simple.SimpleJob; 22 | import lombok.RequiredArgsConstructor; 23 | 24 | @RequiredArgsConstructor 25 | public final class TestWrongJob implements SimpleJob { 26 | 27 | @Override 28 | public void execute(final ShardingContext shardingContext) { 29 | throw new RuntimeException("WrongJobException"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.reg.zookeeper; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.reg.exception.RegException; 21 | import org.junit.Test; 22 | 23 | public final class ZookeeperRegistryCenterInitFailureTest { 24 | 25 | @Test(expected = RegException.class) 26 | public void assertInitFailure() { 27 | ZookeeperRegistryCenter zkRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration("localhost:1", ZookeeperRegistryCenterInitFailureTest.class.getName())); 28 | zkRegCenter.init(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/AllStatisticsTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.statistics; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.statistics.rdb.StatisticRdbRepositoryTest; 21 | import lombok.AccessLevel; 22 | import lombok.NoArgsConstructor; 23 | import org.junit.runner.RunWith; 24 | import org.junit.runners.Suite; 25 | import org.junit.runners.Suite.SuiteClasses; 26 | 27 | @RunWith(Suite.class) 28 | @SuiteClasses(StatisticRdbRepositoryTest.class) 29 | @NoArgsConstructor(access = AccessLevel.PRIVATE) 30 | public final class AllStatisticsTests { 31 | } 32 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/digest/EncryptionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.util.digest; 19 | 20 | import org.hamcrest.core.Is; 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public final class EncryptionTest { 25 | 26 | @Test 27 | public void assertMd5() { 28 | Assert.assertThat(Encryption.md5("test"), Is.is("98f6bcd4621d373cade4e832627b4f6")); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/env/HostExceptionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.util.env; 19 | 20 | import org.hamcrest.core.Is; 21 | import org.junit.Test; 22 | 23 | import java.io.IOException; 24 | 25 | import static org.junit.Assert.assertThat; 26 | 27 | public final class HostExceptionTest { 28 | 29 | @Test 30 | public void assertGetCause() { 31 | IOException cause = new IOException(); 32 | assertThat(new HostException(cause).getCause(), Is.is(cause)); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/env/IpUtilsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.util.env; 19 | 20 | import org.junit.Test; 21 | 22 | import static org.junit.Assert.assertNotNull; 23 | 24 | public final class IpUtilsTest { 25 | 26 | @Test 27 | public void assertGetIp() { 28 | assertNotNull(IpUtils.getIp()); 29 | } 30 | 31 | @Test 32 | public void assertGetHostName() { 33 | assertNotNull(IpUtils.getHostName()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/env/TimeServiceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.util.env; 19 | 20 | import org.junit.Assert; 21 | import org.junit.Test; 22 | 23 | public class TimeServiceTest { 24 | 25 | private TimeService timeService = new TimeService(); 26 | 27 | @Test 28 | public void assertGetCurrentMillis() throws Exception { 29 | Assert.assertTrue(timeService.getCurrentMillis() <= System.currentTimeMillis()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/resources/conf/reg/local.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | /test=test 19 | /test/deep/nested=deepNested 20 | /test/child=child 21 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-common/src/test/resources/conf/reg/local_overwrite.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | /test=test_overwrite 19 | /test/deep/nested=deepNested_overwrite 20 | /new=new 21 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/JobBootstrap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.api; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.executor.TaskExecutor; 21 | import lombok.AccessLevel; 22 | import lombok.NoArgsConstructor; 23 | import org.apache.mesos.MesosExecutorDriver; 24 | import org.apache.mesos.Protos; 25 | 26 | /** 27 | * Job bootstrap. 28 | */ 29 | @NoArgsConstructor(access = AccessLevel.PRIVATE) 30 | public final class JobBootstrap { 31 | 32 | /** 33 | * Execute. 34 | */ 35 | public static void execute() { 36 | MesosExecutorDriver driver = new MesosExecutorDriver(new TaskExecutor()); 37 | System.exit(Protos.Status.DRIVER_STOPPED == driver.run() ? 0 : -1); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/AllCloudExecutorTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.executor; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.executor.local.AllLocalExecutorTests; 21 | import lombok.AccessLevel; 22 | import lombok.NoArgsConstructor; 23 | import org.junit.runner.RunWith; 24 | import org.junit.runners.Suite; 25 | import org.junit.runners.Suite.SuiteClasses; 26 | 27 | @RunWith(Suite.class) 28 | @SuiteClasses({ 29 | CloudJobFacadeTest.class, 30 | DaemonTaskSchedulerTest.class, 31 | JobConfigurationContextTest.class, 32 | TaskExecutorTest.class, 33 | TaskExecutorThreadTest.class, 34 | AllLocalExecutorTests.class 35 | }) 36 | @NoArgsConstructor(access = AccessLevel.PRIVATE) 37 | public final class AllCloudExecutorTests { 38 | } 39 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestJob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.executor.fixture; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.api.ShardingContext; 21 | import org.apache.shardingsphere.elasticjob.cloud.api.simple.SimpleJob; 22 | 23 | public final class TestJob implements SimpleJob { 24 | 25 | @Override 26 | public void execute(final ShardingContext shardingContext) { 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/AllLocalExecutorTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.executor.local; 19 | 20 | import lombok.AccessLevel; 21 | import lombok.NoArgsConstructor; 22 | import org.junit.runner.RunWith; 23 | import org.junit.runners.Suite; 24 | 25 | @RunWith(Suite.class) 26 | @Suite.SuiteClasses(LocalTaskExecutorTest.class) 27 | @NoArgsConstructor(access = AccessLevel.PRIVATE) 28 | public final class AllLocalExecutorTests { 29 | } 30 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-executor/src/test/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-executor/src/test/resources/script/TestScriptJob.bat: -------------------------------------------------------------------------------- 1 | @echo sharding context is %* 2 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-executor/src/test/resources/script/TestScriptJob.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo sharding context is $* 3 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/restful/RestfulException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.restful; 19 | 20 | /** 21 | * Restful api exception. 22 | */ 23 | public final class RestfulException extends RuntimeException { 24 | 25 | private static final long serialVersionUID = -7594937349408972960L; 26 | 27 | public RestfulException(final Throwable cause) { 28 | super(cause); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/restful/RestfulExceptionMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.restful; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.exception.ExceptionUtil; 21 | 22 | import javax.ws.rs.core.MediaType; 23 | import javax.ws.rs.core.Response; 24 | import javax.ws.rs.ext.ExceptionMapper; 25 | import javax.ws.rs.ext.Provider; 26 | 27 | /** 28 | * Restful api exception mapper. 29 | */ 30 | @Provider 31 | public final class RestfulExceptionMapper implements ExceptionMapper { 32 | 33 | @Override 34 | public Response toResponse(final Throwable cause) { 35 | return Response.ok(ExceptionUtil.transform(cause), MediaType.TEXT_PLAIN).status(Response.Status.INTERNAL_SERVER_ERROR).build(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Getter; 22 | import lombok.RequiredArgsConstructor; 23 | import lombok.ToString; 24 | 25 | /** 26 | * Cloud app configuration. 27 | */ 28 | @AllArgsConstructor 29 | @RequiredArgsConstructor 30 | @Getter 31 | @ToString 32 | public final class CloudAppConfiguration { 33 | 34 | private final String appName; 35 | 36 | private final String appURL; 37 | 38 | private final String bootstrapScript; 39 | 40 | private double cpuCount = 1; 41 | 42 | private double memoryMB = 128; 43 | 44 | private boolean appCacheEnable = true; 45 | 46 | private int eventTraceSamplingCount; 47 | } 48 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app; 19 | 20 | import lombok.AccessLevel; 21 | import lombok.NoArgsConstructor; 22 | 23 | /** 24 | * Cloud app configuration node. 25 | */ 26 | @NoArgsConstructor(access = AccessLevel.PRIVATE) 27 | public final class CloudAppConfigurationNode { 28 | 29 | public static final String ROOT = "/config/app"; 30 | 31 | private static final String APP_CONFIG = ROOT + "/%s"; 32 | 33 | static String getRootNodePath(final String appName) { 34 | return String.format(APP_CONFIG, appName); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job; 19 | 20 | import lombok.AccessLevel; 21 | import lombok.NoArgsConstructor; 22 | 23 | /** 24 | * Cloud job configuration node. 25 | */ 26 | @NoArgsConstructor(access = AccessLevel.PRIVATE) 27 | public final class CloudJobConfigurationNode { 28 | 29 | public static final String ROOT = "/config/job"; 30 | 31 | private static final String JOB_CONFIG = ROOT + "/%s"; 32 | 33 | static String getRootNodePath(final String jobName) { 34 | return String.format(JOB_CONFIG, jobName); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobExecutionType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job; 19 | 20 | /** 21 | * Cloud job execution type. 22 | */ 23 | public enum CloudJobExecutionType { 24 | 25 | DAEMON, TRANSIENT 26 | } 27 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/FrameworkConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.env; 19 | 20 | import lombok.Getter; 21 | import lombok.RequiredArgsConstructor; 22 | 23 | /** 24 | * Mesos framework config. 25 | */ 26 | @RequiredArgsConstructor 27 | @Getter 28 | public final class FrameworkConfiguration { 29 | 30 | private final int jobStateQueueSize; 31 | 32 | private final int reconcileIntervalMinutes; 33 | 34 | /** 35 | * Check whether reconcile service is enabled or not. 36 | * 37 | * @return true is enabled, otherwise not 38 | */ 39 | public boolean isEnabledReconcile() { 40 | return reconcileIntervalMinutes > 0; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/MesosConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.env; 19 | 20 | import lombok.Getter; 21 | import lombok.RequiredArgsConstructor; 22 | 23 | /** 24 | * Mesos config. 25 | */ 26 | @RequiredArgsConstructor 27 | @Getter 28 | public final class MesosConfiguration { 29 | 30 | /** 31 | * Framework name. 32 | */ 33 | public static final String FRAMEWORK_NAME = "Elastic-Job-Cloud"; 34 | 35 | /** 36 | * Framework failover timeout in seconds. Default is one week. 37 | */ 38 | public static final double FRAMEWORK_FAILOVER_TIMEOUT_SECONDS = 60 * 60 * 24 * 7D; 39 | 40 | private final String user; 41 | 42 | private final String url; 43 | 44 | private final String hostname; 45 | } 46 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/RestfulServerConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.env; 19 | 20 | import lombok.Getter; 21 | import lombok.RequiredArgsConstructor; 22 | 23 | /** 24 | * Restful config. 25 | */ 26 | @RequiredArgsConstructor 27 | @Getter 28 | public final class RestfulServerConfiguration { 29 | 30 | private final int port; 31 | } 32 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/HANode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.ha; 19 | 20 | /** 21 | * HA node. 22 | */ 23 | public final class HANode { 24 | 25 | /** 26 | * HA node. 27 | */ 28 | public static final String ROOT = "/ha"; 29 | 30 | /** 31 | * FrameworkID node. 32 | */ 33 | public static final String FRAMEWORK_ID_NODE = ROOT + "/framework_id"; 34 | 35 | /** 36 | * Election node. 37 | */ 38 | public static final String ELECTION_NODE = ROOT + "/election"; 39 | } 40 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/StateNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.state; 19 | 20 | import lombok.AccessLevel; 21 | import lombok.NoArgsConstructor; 22 | 23 | /** 24 | * State node. 25 | */ 26 | @NoArgsConstructor(access = AccessLevel.PRIVATE) 27 | public final class StateNode { 28 | 29 | /** 30 | * Root state node. 31 | */ 32 | public static final String ROOT = "/state"; 33 | } 34 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.app; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.StateNode; 21 | import lombok.AccessLevel; 22 | import lombok.NoArgsConstructor; 23 | 24 | /** 25 | * Disable app node. 26 | */ 27 | @NoArgsConstructor(access = AccessLevel.PRIVATE) 28 | final class DisableAppNode { 29 | 30 | static final String ROOT = StateNode.ROOT + "/disable/app"; 31 | 32 | private static final String DISABLE_APP = ROOT + "/%s"; 33 | 34 | static String getDisableAppNodePath(final String appName) { 35 | return String.format(DISABLE_APP, appName); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.StateNode; 21 | import lombok.AccessLevel; 22 | import lombok.NoArgsConstructor; 23 | 24 | /** 25 | * Disable job node. 26 | */ 27 | @NoArgsConstructor(access = AccessLevel.PRIVATE) 28 | final class DisableJobNode { 29 | 30 | static final String ROOT = StateNode.ROOT + "/disable/job"; 31 | 32 | private static final String DISABLE_JOB = ROOT + "/%s"; 33 | 34 | static String getDisableJobNodePath(final String jobName) { 35 | return String.format(DISABLE_JOB, jobName); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverTaskInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.state.failover; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.context.TaskContext; 21 | import lombok.Getter; 22 | import lombok.RequiredArgsConstructor; 23 | 24 | /** 25 | * Failover task info. 26 | */ 27 | @RequiredArgsConstructor 28 | @Getter 29 | public final class FailoverTaskInfo { 30 | 31 | private final TaskContext.MetaInfo taskInfo; 32 | 33 | private final String originalTaskId; 34 | } 35 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.StateNode; 21 | import lombok.AccessLevel; 22 | import lombok.NoArgsConstructor; 23 | 24 | /** 25 | * Ready node. 26 | */ 27 | @NoArgsConstructor(access = AccessLevel.PRIVATE) 28 | final class ReadyNode { 29 | 30 | static final String ROOT = StateNode.ROOT + "/ready"; 31 | 32 | private static final String READY_JOB = ROOT + "/%s"; 33 | 34 | static String getReadyJobNodePath(final String jobName) { 35 | return String.format(READY_JOB, jobName); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/StatisticJob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job; 19 | 20 | import java.util.Map; 21 | 22 | import org.quartz.Job; 23 | import org.quartz.JobDetail; 24 | import org.quartz.Trigger; 25 | 26 | /** 27 | * Statistic job. 28 | */ 29 | public interface StatisticJob extends Job { 30 | 31 | /** 32 | * Build JobDetail. 33 | * 34 | * @return JobDetail 35 | */ 36 | JobDetail buildJobDetail(); 37 | 38 | /** 39 | * Build Trigger. 40 | * 41 | * @return Trigger 42 | */ 43 | Trigger buildTrigger(); 44 | 45 | /** 46 | * Get data map. 47 | * 48 | * @return property map, key is property name, value is property instance 49 | */ 50 | Map getDataMap(); 51 | } 52 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/bin/dcos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | cd .. 4 | DEPLOY_DIR=`pwd` 5 | LIB_DIR=${DEPLOY_DIR}/lib/* 6 | CONTAINER_MAIN=Bootstrap 7 | JAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Djava.library.path=/usr/local/lib:/usr/lib:/usr/lib64" 8 | 9 | java ${JAVA_OPTS} -classpath ${LIB_DIR}:. ${CONTAINER_MAIN} 10 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/bin/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | cd .. 4 | DEPLOY_DIR=`pwd` 5 | CONF_DIR=${DEPLOY_DIR}/conf 6 | LIB_DIR=${DEPLOY_DIR}/lib/* 7 | CONTAINER_MAIN=Bootstrap 8 | JAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Djava.library.path=/usr/local/lib:/usr/lib:/usr/lib64" 9 | 10 | source ${CONF_DIR}/elastic-job-cloud-scheduler.properties 11 | if [ ${hostname} = "" ] || [ ${hostname} = "127.0.0.1" ] || [ ${hostname} = "localhost" ]; then 12 | echo "Please config hostname in conf/elastic-job-cloud-scheduler.properties with a routable IP address." 13 | exit; 14 | fi 15 | export LIBPROCESS_IP=${hostname} 16 | 17 | java ${JAVA_OPTS} -classpath ${CONF_DIR}/*:${LIB_DIR}:. ${CONTAINER_MAIN} 18 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/conf/auth.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | root.username=root 19 | root.password=root 20 | guest.username=guest 21 | guest.password=guest 22 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/favicon.ico -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/i18n/message.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/js/app/add_app.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | $(function() { 19 | validate(); 20 | submitConfirm("post", $("#data-add-app")); 21 | }); 22 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/js/app/modify_app.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | $(function() { 19 | validate(); 20 | submitConfirm("put", $("#data-update-app")); 21 | }); 22 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/js/job/add_job.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | $(function() { 19 | validate(); 20 | dataControl(); 21 | submitConfirm("post", "/api/job/register", $("#data-add-job")); 22 | }); 23 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/js/job/modify_job.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | $(function() { 19 | validate(); 20 | dataControl(); 21 | submitConfirm("put", "/api/job/update", $("#data-update-job")); 22 | }); 23 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/bootstrap-table/bootstrap-table-zh-CN.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Chinese translation 3 | * Author: Zhixin Wen 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['zh-CN'] = { 9 | formatLoadingMessage: function () { 10 | return '正在努力地加载数据中,请稍候……'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return '每页显示 ' + pageNumber + ' 条记录'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return '显示第 ' + pageFrom + ' 到第 ' + pageTo + ' 条记录,总共 ' + totalRows + ' 条记录'; 17 | }, 18 | formatSearch: function () { 19 | return '搜索'; 20 | }, 21 | formatNoMatches: function () { 22 | return '没有找到匹配的记录'; 23 | }, 24 | formatPaginationSwitch: function () { 25 | return '隐藏/显示分页'; 26 | }, 27 | formatRefresh: function () { 28 | return '刷新'; 29 | }, 30 | formatToggle: function () { 31 | return '切换'; 32 | }, 33 | formatColumns: function () { 34 | return '列'; 35 | } 36 | }; 37 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']); 38 | 39 | // BOOTSTRAP TABLE INIT 40 | // ======================= 41 | $(function () { 42 | $('[data-toggle="table"]').bootstrapTable(); 43 | }); 44 | })(jQuery); -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/font-awesome-4.5.0/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/font-awesome-4.5.0/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/font-awesome-4.5.0/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/font-awesome-4.5.0/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/font-awesome-4.5.0/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/font-awesome-4.5.0/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/font-awesome-4.5.0/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/font-awesome-4.5.0/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/font-awesome-4.5.0/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/shardingsphere-elasticjob-cloud/78b49b2bdbd8b5fad6cd508dcf155187ffa2f88b/elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/font-awesome-4.5.0/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/main/resources/console/lib/input-mask/phone-codes/readme.txt: -------------------------------------------------------------------------------- 1 | more phone masks can be found at https://github.com/andr-04/inputmask-multi -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/AllTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.restful.AllRestfulTests; 21 | import org.apache.shardingsphere.elasticjob.cloud.scheduler.AllCloudSchedulerTests; 22 | import lombok.AccessLevel; 23 | import lombok.NoArgsConstructor; 24 | import org.junit.runner.RunWith; 25 | import org.junit.runners.Suite; 26 | import org.junit.runners.Suite.SuiteClasses; 27 | 28 | @RunWith(Suite.class) 29 | @SuiteClasses({ 30 | AllCloudSchedulerTests.class, 31 | AllRestfulTests.class 32 | }) 33 | @NoArgsConstructor(access = AccessLevel.PRIVATE) 34 | public final class AllTests { 35 | } 36 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/restful/AllRestfulTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.restful; 19 | 20 | import lombok.AccessLevel; 21 | import lombok.NoArgsConstructor; 22 | import org.junit.runner.RunWith; 23 | import org.junit.runners.Suite; 24 | import org.junit.runners.Suite.SuiteClasses; 25 | 26 | @RunWith(Suite.class) 27 | @SuiteClasses({ 28 | RestfulServerTest.class, 29 | RestfulExceptionTest.class 30 | }) 31 | @NoArgsConstructor(access = AccessLevel.PRIVATE) 32 | public final class AllRestfulTests { 33 | } 34 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/restful/RestfulExceptionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.restful; 19 | 20 | import org.hamcrest.core.IsInstanceOf; 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public final class RestfulExceptionTest { 25 | 26 | @Test 27 | public void assertRestfulException() { 28 | Assert.assertThat(new RestfulException(new RuntimeException()).getCause(), IsInstanceOf.instanceOf(RuntimeException.class)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/restful/fixture/Caller.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.restful.fixture; 19 | 20 | public interface Caller { 21 | 22 | /** 23 | * Call. 24 | * @param value String value 25 | */ 26 | void call(String value); 27 | 28 | /** 29 | * Call. 30 | * @param value int value 31 | */ 32 | void call(int value); 33 | } 34 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/AllConfigTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.config; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.AllCloudAppConfigTests; 21 | import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.AllCloudJobConfigTests; 22 | import org.junit.runner.RunWith; 23 | import org.junit.runners.Suite; 24 | 25 | @RunWith(Suite.class) 26 | @Suite.SuiteClasses({ 27 | AllCloudAppConfigTests.class, 28 | AllCloudJobConfigTests.class 29 | }) 30 | public final class AllConfigTests { 31 | } 32 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/AllCloudAppConfigTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app; 19 | 20 | import org.junit.runner.RunWith; 21 | import org.junit.runners.Suite; 22 | 23 | @RunWith(Suite.class) 24 | @Suite.SuiteClasses({ 25 | CloudAppConfigurationNodeTest.class, 26 | CloudAppConfigurationServiceTest.class 27 | }) 28 | public final class AllCloudAppConfigTests { 29 | } 30 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app; 19 | 20 | import org.hamcrest.core.Is; 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public final class CloudAppConfigurationNodeTest { 25 | 26 | @Test 27 | public void assertGetRootNodePath() { 28 | Assert.assertThat(CloudAppConfigurationNode.getRootNodePath("test_job_app"), Is.is("/config/app/test_job_app")); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/AllCloudJobConfigTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job; 19 | 20 | import org.junit.runner.RunWith; 21 | import org.junit.runners.Suite; 22 | 23 | @RunWith(Suite.class) 24 | @Suite.SuiteClasses({ 25 | CloudJobConfigurationNodeTest.class, 26 | CloudJobConfigurationServiceTest.class, 27 | CloudJobConfigurationListenerTest.class 28 | }) 29 | public class AllCloudJobConfigTests { 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job; 19 | 20 | import org.hamcrest.core.Is; 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public final class CloudJobConfigurationNodeTest { 25 | 26 | @Test 27 | public void assertGetRootNodePath() { 28 | Assert.assertThat(CloudJobConfigurationNode.getRootNodePath("test_job"), Is.is("/config/job/test_job")); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/AllContextTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.context; 19 | 20 | import org.junit.runner.RunWith; 21 | import org.junit.runners.Suite; 22 | 23 | @RunWith(Suite.class) 24 | @Suite.SuiteClasses(JobContextTest.class) 25 | public final class AllContextTests { 26 | } 27 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AllEnvTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.env; 19 | 20 | import org.junit.runner.RunWith; 21 | import org.junit.runners.Suite; 22 | 23 | @RunWith(Suite.class) 24 | @Suite.SuiteClasses(BootstrapEnvironmentTest.class) 25 | public final class AllEnvTests { 26 | } 27 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppConfigurationBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfiguration; 21 | import lombok.AccessLevel; 22 | import lombok.NoArgsConstructor; 23 | 24 | @NoArgsConstructor(access = AccessLevel.PRIVATE) 25 | public final class CloudAppConfigurationBuilder { 26 | 27 | /** 28 | * Create cloud app configuration. 29 | * @param appName app name 30 | * @return CloudAppConfiguration 31 | */ 32 | public static CloudAppConfiguration createCloudAppConfiguration(final String appName) { 33 | return new CloudAppConfiguration(appName, "http://localhost/app.jar", "bin/start.sh"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TestSimpleJob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.api.ShardingContext; 21 | import org.apache.shardingsphere.elasticjob.cloud.api.simple.SimpleJob; 22 | 23 | public final class TestSimpleJob implements SimpleJob { 24 | 25 | @Override 26 | public void execute(final ShardingContext shardingContext) { 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/AllHATests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.ha; 19 | 20 | import org.junit.runner.RunWith; 21 | import org.junit.runners.Suite; 22 | 23 | @RunWith(Suite.class) 24 | @Suite.SuiteClasses(FrameworkIDServiceTest.class) 25 | public class AllHATests { 26 | } 27 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos; 19 | 20 | import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.fixture.OfferBuilder; 21 | import org.hamcrest.core.Is; 22 | import org.junit.Assert; 23 | import org.junit.Test; 24 | 25 | public final class LeasesQueueTest { 26 | 27 | private LeasesQueue leasesQueue = LeasesQueue.getInstance(); 28 | 29 | @Test 30 | public void assertOperate() { 31 | Assert.assertTrue(leasesQueue.drainTo().isEmpty()); 32 | leasesQueue.offer(OfferBuilder.createOffer("offer_1")); 33 | leasesQueue.offer(OfferBuilder.createOffer("offer_2")); 34 | Assert.assertThat(leasesQueue.drainTo().size(), Is.is(2)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/AllProducerTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.producer; 19 | 20 | import org.junit.runner.RunWith; 21 | import org.junit.runners.Suite; 22 | 23 | @RunWith(Suite.class) 24 | @Suite.SuiteClasses({ 25 | ProducerJobTest.class, 26 | TransientProducerRepositoryTest.class, 27 | TransientProducerSchedulerTest.class, 28 | ProducerManagerTest.class 29 | }) 30 | public final class AllProducerTests { 31 | } 32 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/AllRestfulTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.restful; 19 | 20 | import org.junit.runner.RunWith; 21 | import org.junit.runners.Suite; 22 | 23 | @RunWith(Suite.class) 24 | @Suite.SuiteClasses({ 25 | CloudJobRestfulApiTest.class, 26 | CloudAppRestfulApiTest.class, 27 | CloudOperationRestfulApiTest.class 28 | }) 29 | public final class AllRestfulTests { 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.app; 19 | 20 | import org.hamcrest.core.Is; 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public final class DisableAppNodeTest { 25 | 26 | @Test 27 | public void assertGetDisableAppNodePath() { 28 | Assert.assertThat(DisableAppNode.getDisableAppNodePath("test_app0000000001"), Is.is("/state/disable/app/test_app0000000001")); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job; 19 | 20 | import org.hamcrest.core.Is; 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public final class DisableJobNodeTest { 25 | 26 | @Test 27 | public void assertGetDisableAppNodePath() { 28 | Assert.assertThat(DisableJobNode.getDisableJobNodePath("test_job0000000001"), Is.is("/state/disable/job/test_job0000000001")); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/elastic-job-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready; 19 | 20 | import org.hamcrest.core.Is; 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public final class ReadyNodeTest { 25 | 26 | @Test 27 | public void assertGetReadyJobNodePath() { 28 | Assert.assertThat(ReadyNode.getReadyJobNodePath("test_job0000000001"), Is.is("/state/ready/test_job0000000001")); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/examples/.gitignore: -------------------------------------------------------------------------------- 1 | # maven ignore 2 | target/ 3 | *.jar 4 | *.war 5 | *.zip 6 | *.tar 7 | 8 | # eclipse ignore 9 | .settings/ 10 | .project 11 | .classpath 12 | 13 | # idea ignore 14 | .idea/ 15 | *.ipr 16 | *.iml 17 | *.iws 18 | 19 | # temp ignore 20 | logs/ 21 | *.doc 22 | *.log 23 | *.cache 24 | *.diff 25 | *.patch 26 | *.tmp 27 | 28 | # system ignore 29 | .DS_Store 30 | Thumbs.db 31 | -------------------------------------------------------------------------------- /elasticjob-cloud/examples/README.md: -------------------------------------------------------------------------------- 1 | # elastic-job-example 2 | 3 | Elastic-Job 2.x example. 4 | 5 | Example for 1.x please see tags in `https://github.com/elasticjob/elastic-job/tree/${tag}/elastic-job-example` 6 | -------------------------------------------------------------------------------- /elasticjob-cloud/examples/elastic-job-example-cloud/src/main/java/com/dangdang/ddframe/job/example/CloudJobMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2015 dangdang.com. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *

16 | */ 17 | 18 | package com.dangdang.ddframe.job.example; 19 | 20 | import com.dangdang.ddframe.job.cloud.api.JobBootstrap; 21 | 22 | public final class CloudJobMain { 23 | 24 | // CHECKSTYLE:OFF 25 | public static void main(final String[] args) { 26 | // CHECKSTYLE:ON 27 | JobBootstrap.execute(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /elasticjob-cloud/examples/elastic-job-example-cloud/src/main/resources/META-INF/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /elasticjob-cloud/examples/elastic-job-example-cloud/src/main/resources/assembly/assembly.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | tar.gz 4 | 5 | false 6 | 7 | 8 | src/main/resources/bin 9 | bin 10 | 0755 11 | 12 | 13 | src/main/resources/script 14 | script 15 | 0755 16 | 17 | 18 | 19 | 20 | 21 | lib 22 | 0644 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /elasticjob-cloud/examples/elastic-job-example-cloud/src/main/resources/bin/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | java -classpath lib/*:. com.dangdang.ddframe.job.example.CloudJobMain 3 | -------------------------------------------------------------------------------- /elasticjob-cloud/examples/elastic-job-example-cloud/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ${log.context.name} 9 | 10 | 11 | 12 | ${log.pattern} 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /elasticjob-cloud/examples/elastic-job-example-cloud/src/main/resources/script/demo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo sharding execution context is $* -------------------------------------------------------------------------------- /elasticjob-cloud/examples/elastic-job-example-embed-zk/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | elastic-job-example 7 | com.dangdang 8 | 2.1.5 9 | 10 | 4.0.0 11 | elastic-job-example-embed-zk 12 | ${project.artifactId} 13 | 14 | 15 | 16 | org.apache.curator 17 | curator-test 18 | 19 | 20 | -------------------------------------------------------------------------------- /elasticjob-cloud/examples/elastic-job-example-jobs/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | elastic-job-example 4 | com.dangdang 5 | 2.1.5 6 | 7 | 4.0.0 8 | elastic-job-example-jobs 9 | ${project.artifactId} 10 | 11 | 12 | 13 | com.dangdang 14 | elastic-job-common-core 15 | ${project.parent.version} 16 | 17 | 18 | org.springframework 19 | spring-context 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /elasticjob-cloud/examples/elastic-job-example-jobs/src/main/java/com/dangdang/ddframe/job/example/fixture/repository/FooRepositoryFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2015 dangdang.com. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *

16 | */ 17 | 18 | package com.dangdang.ddframe.job.example.fixture.repository; 19 | 20 | public final class FooRepositoryFactory { 21 | 22 | private static FooRepository fooRepository = new FooRepository(); 23 | 24 | public static FooRepository getFooRepository() { 25 | return fooRepository; 26 | } 27 | 28 | } 29 | --------------------------------------------------------------------------------