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 |
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 | *
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