diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java index 7b7e841f8a..8e4115a8d7 100644 --- a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java @@ -49,14 +49,13 @@ * @return timeZone */ String timeZone() default ""; - - + /** * registry center name. * @return registryCenter */ String registryCenter() default ""; - + /** * Sharding total count. * @return shardingTotalCount diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ElasticJob.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ElasticJob.java index 882d1a5cfb..cd6842b040 100644 --- a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ElasticJob.java +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ElasticJob.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java index 0fe7ab486b..17e384bcd4 100644 --- a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -122,9 +122,9 @@ public static class Builder { private String jobExecutorServiceHandlerType; private String jobErrorHandlerType; - + private final Collection jobListenerTypes = new ArrayList<>(); - + private final Collection extraConfigurations = new LinkedList<>(); private String description = ""; @@ -134,11 +134,11 @@ public static class Builder { private boolean disabled; private boolean overwrite; - + private String label; private boolean staticSharding; - + /** * Cron expression. * @@ -151,7 +151,7 @@ public Builder cron(final String cron) { } return this; } - + /** * time zone. * @@ -171,7 +171,6 @@ public Builder timeZone(final String timeZone) { *

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

@@ -206,7 +205,6 @@ public Builder jobParameter(final String jobParameter) { *

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

* diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfiguration.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfiguration.java index 4307260e14..068e38e9e4 100644 --- a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfiguration.java +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfiguration.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java index 8670ed93a2..b6cbfa15f7 100644 --- a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java index 65b2d7461a..dfbe098ec4 100644 --- a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java index e7dd40b40e..8c4692ee22 100644 --- a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java @@ -38,13 +38,13 @@ public void assertAnnotationJob() { assertThat(annotation.cron(), is("0/5 * * * * ?")); assertThat(annotation.shardingTotalCount(), is(3)); assertThat(annotation.shardingItemParameters(), is("0=Beijing,1=Shanghai,2=Guangzhou")); - for (Class factory :annotation.extraConfigurations()) { + for (Class factory : annotation.extraConfigurations()) { assertThat(factory, is(SimpleTracingConfigurationFactory.class)); } - assertArrayEquals(annotation.jobListenerTypes(), new String[] {"NOOP", "LOG"}); + assertArrayEquals(annotation.jobListenerTypes(), new String[]{"NOOP", "LOG"}); Queue propsKey = new LinkedList<>(Arrays.asList("print.title", "print.content")); Queue propsValue = new LinkedList<>(Arrays.asList("test title", "test content")); - for (ElasticJobProp prop :annotation.props()) { + for (ElasticJobProp prop : annotation.props()) { assertThat(prop.key(), is(propsKey.poll())); assertThat(prop.value(), is(propsValue.poll())); } diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java index fbad39c622..e47b9e54cc 100644 --- a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java index 1c85c78328..3a9c01dcaa 100644 --- a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java @@ -24,17 +24,16 @@ import org.apache.shardingsphere.elasticjob.api.ShardingContext; @ElasticJobConfiguration( - cron = "0/5 * * * * ?", - jobName = "SimpleTestJob", - shardingTotalCount = 3, - shardingItemParameters = "0=Beijing,1=Shanghai,2=Guangzhou", - jobListenerTypes = {"NOOP", "LOG"}, - extraConfigurations = {SimpleTracingConfigurationFactory.class}, - props = { - @ElasticJobProp(key = "print.title", value = "test title"), - @ElasticJobProp(key = "print.content", value = "test content") - } -) + cron = "0/5 * * * * ?", + jobName = "SimpleTestJob", + shardingTotalCount = 3, + shardingItemParameters = "0=Beijing,1=Shanghai,2=Guangzhou", + jobListenerTypes = {"NOOP", "LOG"}, + extraConfigurations = {SimpleTracingConfigurationFactory.class}, + props = { + @ElasticJobProp(key = "print.title", value = "test title"), + @ElasticJobProp(key = "print.content", value = "test content") + }) public final class SimpleTestJob implements CustomJob { @Override diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java index b275af4120..1e7412c21c 100644 --- a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -84,13 +84,11 @@ public void assertBuildRequiredProperties() { @Test public void assertBuildWithEmptyJobName() { - assertThrows(IllegalArgumentException.class, () -> - JobConfiguration.newBuilder("", 3).cron("0/1 * * * * ?").build()); + assertThrows(IllegalArgumentException.class, () -> JobConfiguration.newBuilder("", 3).cron("0/1 * * * * ?").build()); } - + @Test public void assertBuildWithInvalidShardingTotalCount() { - assertThrows(IllegalArgumentException.class, () -> - JobConfiguration.newBuilder("test_job", -1).cron("0/1 * * * * ?").build()); + assertThrows(IllegalArgumentException.class, () -> JobConfiguration.newBuilder("test_job", -1).cron("0/1 * * * * ?").build()); } } diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobConfiguration.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobConfiguration.java index 3aed437bd5..b61dc99233 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobConfiguration.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobConfiguration.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobExecutionType.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobExecutionType.java index 58c0b155bb..f7ea0e1f2b 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobExecutionType.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobExecutionType.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJO.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJO.java index cac9d66f17..3465db59c9 100644 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJO.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJO.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/StatisticInterval.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/StatisticInterval.java index fc9f7e36c8..dd285852ca 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/StatisticInterval.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/StatisticInterval.java @@ -29,7 +29,7 @@ public enum StatisticInterval { MINUTE("0 * * * * ?"), - HOUR("0 0 * * * ?"), + HOUR("0 0 * * * ?"), DAY("0 0 0 * * ?"); diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java index 5b696181f9..7490279523 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java @@ -46,13 +46,13 @@ public class StatisticRdbRepository { private static final String TABLE_TASK_RESULT_STATISTICS = "TASK_RESULT_STATISTICS"; private static final String TABLE_TASK_RUNNING_STATISTICS = "TASK_RUNNING_STATISTICS"; - + private static final String TABLE_JOB_RUNNING_STATISTICS = "JOB_RUNNING_STATISTICS"; private static final String TABLE_JOB_REGISTER_STATISTICS = "JOB_REGISTER_STATISTICS"; private final DataSource dataSource; - + public StatisticRdbRepository(final DataSource dataSource) throws SQLException { this.dataSource = dataSource; initTables(); @@ -153,7 +153,7 @@ private void createJobRegisterTable(final Connection conn) throws SQLException { preparedStatement.execute(); } } - + /** * Add task result statistics. * @@ -179,7 +179,7 @@ public boolean add(final TaskResultStatistics taskResultStatistics) { } return result; } - + /** * Add task running statistics. * @@ -203,7 +203,7 @@ public boolean add(final TaskRunningStatistics taskRunningStatistics) { } return result; } - + /** * Add job running statistics. * @@ -227,7 +227,7 @@ public boolean add(final JobRunningStatistics jobRunningStatistics) { } return result; } - + /** * Add job register statistics. * @@ -251,7 +251,7 @@ public boolean add(final JobRegisterStatistics jobRegisterStatistics) { } return result; } - + /** * Find task result statistics. * @@ -262,15 +262,14 @@ public boolean add(final JobRegisterStatistics jobRegisterStatistics) { public List findTaskResultStatistics(final Date from, final StatisticInterval statisticInterval) { List result = new LinkedList<>(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String sql = String.format("SELECT id, success_count, failed_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", + String sql = String.format("SELECT id, success_count, failed_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", TABLE_TASK_RESULT_STATISTICS + "_" + statisticInterval, formatter.format(from)); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - TaskResultStatistics taskResultStatistics = new TaskResultStatistics(resultSet.getLong(1), resultSet.getInt(2), resultSet.getInt(3), + TaskResultStatistics taskResultStatistics = new TaskResultStatistics(resultSet.getLong(1), resultSet.getInt(2), resultSet.getInt(3), statisticInterval, new Date(resultSet.getTimestamp(4).getTime()), new Date(resultSet.getTimestamp(5).getTime())); result.add(taskResultStatistics); } @@ -280,7 +279,7 @@ public List findTaskResultStatistics(final Date from, fina } return result; } - + /** * Get summed task result statistics. * @@ -291,13 +290,12 @@ public List findTaskResultStatistics(final Date from, fina public TaskResultStatistics getSummedTaskResultStatistics(final Date from, final StatisticInterval statisticInterval) { TaskResultStatistics result = new TaskResultStatistics(0, 0, statisticInterval, new Date()); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String sql = String.format("SELECT sum(success_count), sum(failed_count) FROM %s WHERE statistics_time >= '%s'", + String sql = String.format("SELECT sum(success_count), sum(failed_count) FROM %s WHERE statistics_time >= '%s'", TABLE_TASK_RESULT_STATISTICS + "_" + statisticInterval, formatter.format(from)); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { result = new TaskResultStatistics(resultSet.getInt(1), resultSet.getInt(2), statisticInterval, new Date()); } @@ -307,7 +305,7 @@ public TaskResultStatistics getSummedTaskResultStatistics(final Date from, final } return result; } - + /** * Find latest task result statistics. * @@ -316,15 +314,14 @@ public TaskResultStatistics getSummedTaskResultStatistics(final Date from, final */ public Optional findLatestTaskResultStatistics(final StatisticInterval statisticInterval) { TaskResultStatistics result = null; - String sql = String.format("SELECT id, success_count, failed_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", + String sql = String.format("SELECT id, success_count, failed_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", TABLE_TASK_RESULT_STATISTICS + "_" + statisticInterval); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - result = new TaskResultStatistics(resultSet.getLong(1), resultSet.getInt(2), resultSet.getInt(3), + result = new TaskResultStatistics(resultSet.getLong(1), resultSet.getInt(2), resultSet.getInt(3), statisticInterval, new Date(resultSet.getTimestamp(4).getTime()), new Date(resultSet.getTimestamp(5).getTime())); } } catch (final SQLException ex) { @@ -333,7 +330,7 @@ public Optional findLatestTaskResultStatistics(final Stati } return Optional.ofNullable(result); } - + /** * Find task running statistics. * @@ -343,15 +340,14 @@ public Optional findLatestTaskResultStatistics(final Stati public List findTaskRunningStatistics(final Date from) { List result = new LinkedList<>(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", + String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", TABLE_TASK_RUNNING_STATISTICS, formatter.format(from)); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - TaskRunningStatistics taskRunningStatistics = new TaskRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), + TaskRunningStatistics taskRunningStatistics = new TaskRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); result.add(taskRunningStatistics); } @@ -361,7 +357,7 @@ public List findTaskRunningStatistics(final Date from) { } return result; } - + /** * Find job running statistics. * @@ -371,15 +367,14 @@ public List findTaskRunningStatistics(final Date from) { public List findJobRunningStatistics(final Date from) { List result = new LinkedList<>(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", + String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", TABLE_JOB_RUNNING_STATISTICS, formatter.format(from)); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - JobRunningStatistics jobRunningStatistics = new JobRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), + JobRunningStatistics jobRunningStatistics = new JobRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); result.add(jobRunningStatistics); } @@ -389,7 +384,7 @@ public List findJobRunningStatistics(final Date from) { } return result; } - + /** * Find latest task running statistics. * @@ -397,15 +392,14 @@ public List findJobRunningStatistics(final Date from) { */ public Optional findLatestTaskRunningStatistics() { TaskRunningStatistics result = null; - String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", + String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", TABLE_TASK_RUNNING_STATISTICS); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - result = new TaskRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), + result = new TaskRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); } } catch (final SQLException ex) { @@ -414,7 +408,7 @@ public Optional findLatestTaskRunningStatistics() { } return Optional.ofNullable(result); } - + /** * Find latest job running statistics. * @@ -426,10 +420,9 @@ public Optional findLatestJobRunningStatistics() { try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - result = new JobRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), + result = new JobRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); } } catch (final SQLException ex) { @@ -438,7 +431,7 @@ public Optional findLatestJobRunningStatistics() { } return Optional.ofNullable(result); } - + /** * Find job register statistics. * @@ -448,15 +441,14 @@ public Optional findLatestJobRunningStatistics() { public List findJobRegisterStatistics(final Date from) { List result = new LinkedList<>(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String sql = String.format("SELECT id, registered_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", + String sql = String.format("SELECT id, registered_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", TABLE_JOB_REGISTER_STATISTICS, formatter.format(from)); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - JobRegisterStatistics jobRegisterStatistics = new JobRegisterStatistics(resultSet.getLong(1), resultSet.getInt(2), + JobRegisterStatistics jobRegisterStatistics = new JobRegisterStatistics(resultSet.getLong(1), resultSet.getInt(2), new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); result.add(jobRegisterStatistics); } @@ -466,7 +458,7 @@ public List findJobRegisterStatistics(final Date from) { } return result; } - + /** * Find latest job register statistics. * @@ -474,15 +466,14 @@ public List findJobRegisterStatistics(final Date from) { */ public Optional findLatestJobRegisterStatistics() { JobRegisterStatistics result = null; - String sql = String.format("SELECT id, registered_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", + String sql = String.format("SELECT id, registered_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", TABLE_JOB_REGISTER_STATISTICS); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - result = new JobRegisterStatistics(resultSet.getLong(1), resultSet.getInt(2), + result = new JobRegisterStatistics(resultSet.getLong(1), resultSet.getInt(2), new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); } } catch (final SQLException ex) { diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java index eabc0dfe3a..7921eff7a4 100644 --- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/JobBootstrap.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/JobBootstrap.java index c399c6da22..824fe2adfa 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/JobBootstrap.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/JobBootstrap.java @@ -51,5 +51,5 @@ public static void execute(final String elasticJobType) { private static void execute(final TaskExecutor taskExecutor) { MesosExecutorDriver driver = new MesosExecutorDriver(taskExecutor); System.exit(Protos.Status.DRIVER_STOPPED == driver.run() ? 0 : -1); - } + } } diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskScheduler.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskScheduler.java index 1d78a523d9..12d44a2cc5 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskScheduler.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskScheduler.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -148,7 +148,7 @@ public static final class DaemonJob implements Job { @Setter private ElasticJob elasticJob; - + @Setter private String elasticJobType; @@ -157,7 +157,7 @@ public static final class DaemonJob implements Job { @Setter private ExecutorDriver executorDriver; - + @Setter private Protos.TaskID taskId; diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutor.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutor.java index 5a0dc42312..7ece00d1e7 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutor.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutor.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -149,7 +149,7 @@ public void run() { throw ex; } } - + private boolean isTransient(final JobConfiguration jobConfig) { return Strings.isNullOrEmpty(jobConfig.getCron()); } @@ -160,7 +160,7 @@ private ElasticJobExecutor getJobExecutor(final JobFacade jobFacade) { } return jobExecutor; } - + private synchronized void createJobExecutor(final JobFacade jobFacade) { if (null != jobExecutor) { return; diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/facade/CloudJobFacade.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/facade/CloudJobFacade.java index e1f324c340..022c2518b7 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/facade/CloudJobFacade.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/facade/CloudJobFacade.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -109,7 +109,7 @@ public void postJobExecutionEvent(final JobExecutionEvent jobExecutionEvent) { @Override public void postJobStatusTraceEvent(final String taskId, final State state, final String message) { TaskContext taskContext = TaskContext.from(taskId); - jobTracingEventBus.post(new JobStatusTraceEvent(taskContext.getMetaInfo().getJobName(), taskContext.getId(), taskContext.getSlaveId(), + jobTracingEventBus.post(new JobStatusTraceEvent(taskContext.getMetaInfo().getJobName(), taskContext.getId(), taskContext.getSlaveId(), Source.CLOUD_EXECUTOR, taskContext.getType().toString(), String.valueOf(taskContext.getMetaInfo().getShardingItems()), state, message)); } } diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java index eae59825fd..2fd7214f47 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestDataflowJob.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestDataflowJob.java index 7445d824ce..fe352f0c2d 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestDataflowJob.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestDataflowJob.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestSimpleJob.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestSimpleJob.java index 7c3cec0247..3ba79a9b83 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestSimpleJob.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestSimpleJob.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java index c01e68fd4f..a2c6e5e7bf 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java @@ -59,7 +59,6 @@ public void assertScriptJob() { @Test public void assertNotExistsJobType() { - assertThrows(JobConfigurationException.class, () -> - new LocalTaskExecutor("not exist", JobConfiguration.newBuilder("not exist", 3).cron("*/2 * * * * ?").build(), 1).execute()); + assertThrows(JobConfigurationException.class, () -> new LocalTaskExecutor("not exist", JobConfiguration.newBuilder("not exist", 3).cron("*/2 * * * * ?").build(), 1).execute()); } } diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java index cd0a24a7df..56658ee244 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java index a623379b8f..1450e0b78e 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java index 335ffab01b..ad0d521e96 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml index c2b9c0bb28..0ca4665684 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml @@ -25,7 +25,7 @@ elasticjob-cloud-scheduler ${project.artifactId} - + 5.2.7.RELEASE @@ -49,7 +49,7 @@ org.apache.httpcomponents httpcore - + org.apache.commons commons-lang3 diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearch.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearch.java index 0cd65775ef..a3b42e734f 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearch.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearch.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -49,14 +49,14 @@ public final class JobEventRdbSearch { private static final String TABLE_JOB_STATUS_TRACE_LOG = "JOB_STATUS_TRACE_LOG"; - private static final List FIELDS_JOB_EXECUTION_LOG = + private static final List FIELDS_JOB_EXECUTION_LOG = Arrays.asList("id", "hostname", "ip", "task_id", "job_name", "execution_source", "sharding_item", "start_time", "complete_time", "is_success", "failure_cause"); - private static final List FIELDS_JOB_STATUS_TRACE_LOG = + private static final List FIELDS_JOB_STATUS_TRACE_LOG = Arrays.asList("id", "job_name", "original_task_id", "task_id", "slave_id", "source", "execution_type", "sharding_item", "state", "message", "creation_time"); private final DataSource dataSource; - + /** * Find job execution events. * @@ -66,7 +66,7 @@ public final class JobEventRdbSearch { public Result findJobExecutionEvents(final Condition condition) { return new Result<>(getEventCount(TABLE_JOB_EXECUTION_LOG, FIELDS_JOB_EXECUTION_LOG, condition), getJobExecutionEvents(condition)); } - + /** * Find job status trace events. * @@ -82,12 +82,11 @@ private List getJobExecutionEvents(final Condition condition) try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = createDataPreparedStatement(conn, TABLE_JOB_EXECUTION_LOG, FIELDS_JOB_EXECUTION_LOG, condition); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { JobExecutionEvent jobExecutionEvent = new JobExecutionEvent(resultSet.getString(1), resultSet.getString(2), resultSet.getString(3), resultSet.getString(4), - resultSet.getString(5), JobExecutionEvent.ExecutionSource.valueOf(resultSet.getString(6)), Integer.parseInt(resultSet.getString(7)), - new Date(resultSet.getTimestamp(8).getTime()), resultSet.getTimestamp(9) == null ? null : new Date(resultSet.getTimestamp(9).getTime()), + resultSet.getString(5), JobExecutionEvent.ExecutionSource.valueOf(resultSet.getString(6)), Integer.parseInt(resultSet.getString(7)), + new Date(resultSet.getTimestamp(8).getTime()), resultSet.getTimestamp(9) == null ? null : new Date(resultSet.getTimestamp(9).getTime()), resultSet.getBoolean(10), resultSet.getString(11)); result.add(jobExecutionEvent); } @@ -103,8 +102,7 @@ private List getJobStatusTraceEvents(final Condition condit try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = createDataPreparedStatement(conn, TABLE_JOB_STATUS_TRACE_LOG, FIELDS_JOB_STATUS_TRACE_LOG, condition); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent(resultSet.getString(1), resultSet.getString(2), resultSet.getString(3), resultSet.getString(4), resultSet.getString(5), JobStatusTraceEvent.Source.valueOf(resultSet.getString(6)), resultSet.getString(7), resultSet.getString(8), @@ -123,8 +121,7 @@ private int getEventCount(final String tableName, final Collection table try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = createCountPreparedStatement(conn, tableName, tableFields, condition); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { resultSet.next(); result = resultSet.getInt(1); } catch (final SQLException ex) { @@ -256,7 +253,7 @@ private String buildLimit(final int page, final int perPage) { } return sqlBuilder.toString(); } - + /** * Query condition. */ diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJO.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJO.java index a6c6142892..7c5db87946 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJO.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJO.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListener.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListener.java index 43d4464d6c..ec422a7f18 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListener.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListener.java @@ -79,7 +79,7 @@ public void event(final Type type, final ChildData oldData, final ChildData data private boolean isJobConfigNode(final String path) { return path.startsWith(CloudJobConfigurationNode.ROOT) && path.length() > CloudJobConfigurationNode.ROOT.length(); } - + private CloudJobConfigurationPOJO getCloudJobConfiguration(final ChildData data) { try { return YamlEngine.unmarshal(new String(data.getData()), CloudJobConfigurationPOJO.class); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AuthConfiguration.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AuthConfiguration.java index c11aadd539..2d5b14bd5d 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AuthConfiguration.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AuthConfiguration.java @@ -26,9 +26,9 @@ @RequiredArgsConstructor @Getter public class AuthConfiguration { - + private final String authUsername; - + private final String authPassword; - + } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironment.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironment.java index 699021f1fb..81fccc9d55 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironment.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironment.java @@ -121,7 +121,7 @@ public RestfulServerConfiguration getRestfulServerConfiguration() { public FrameworkConfiguration getFrameworkConfiguration() { return new FrameworkConfiguration(Integer.parseInt(getValue(EnvironmentArgument.JOB_STATE_QUEUE_SIZE)), Integer.parseInt(getValue(EnvironmentArgument.RECONCILE_INTERVAL_MINUTES))); } - + /** * Get user auth config. * @@ -215,17 +215,17 @@ public enum EnvironmentArgument { JOB_STATE_QUEUE_SIZE("job_state_queue_size", "10000", true), EVENT_TRACE_RDB_DRIVER("event_trace_rdb_driver", "", false), - + EVENT_TRACE_RDB_URL("event_trace_rdb_url", "", false), - + EVENT_TRACE_RDB_USERNAME("event_trace_rdb_username", "", false), - + EVENT_TRACE_RDB_PASSWORD("event_trace_rdb_password", "", false), - + RECONCILE_INTERVAL_MINUTES("reconcile_interval_minutes", "-1", false), - + AUTH_USERNAME("auth_username", "root", true), - + AUTH_PASSWORD("auth_password", "pwd", true); private final String key; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/AppConfigurationException.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/AppConfigurationException.java index bb79dbee95..eef4bf8f28 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/AppConfigurationException.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/AppConfigurationException.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java index 34b8967043..3055df8e0c 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java @@ -40,7 +40,7 @@ public void startLeadership() { try { schedulerService = new SchedulerService(regCenter); schedulerService.start(); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Throwable throwable) { throw new JobSystemException(throwable); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasks.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasks.java index c7244b640f..9ba46afd84 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasks.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasks.java @@ -80,8 +80,8 @@ Collection getIntegrityViolationJobs(final Collection getAssignedJobShardingTotalCountMap(final Collection vmAssignmentResults) { Map result = new HashMap<>(eligibleJobContextsMap.size(), 1); - for (VMAssignmentResult vmAssignmentResult: vmAssignmentResults) { - for (TaskAssignmentResult tasksAssigned: vmAssignmentResult.getTasksAssigned()) { + for (VMAssignmentResult vmAssignmentResult : vmAssignmentResults) { + for (TaskAssignmentResult tasksAssigned : vmAssignmentResult.getTasksAssigned()) { String jobName = TaskContext.from(tasksAssigned.getTaskId()).getMetaInfo().getJobName(); if (result.containsKey(jobName)) { result.put(jobName, result.get(jobName) + 1); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileService.java index 4b7d7e75b8..ce755deab1 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileService.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileService.java @@ -72,10 +72,9 @@ public void explicitReconcile() { return; } log.info("Requesting {} tasks reconciliation with the Mesos master", runningTask.size()); - schedulerDriver.reconcileTasks(runningTask.stream().map(each -> - TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(each.getId()).build()) - .setSlaveId(Protos.SlaveID.newBuilder().setValue(each.getSlaveId()).build()) - .setState(Protos.TaskState.TASK_RUNNING).build()).collect(Collectors.toList())); + schedulerDriver.reconcileTasks(runningTask.stream().map(each -> TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(each.getId()).build()) + .setSlaveId(Protos.SlaveID.newBuilder().setValue(each.getSlaveId()).build()) + .setState(Protos.TaskState.TASK_RUNNING).build()).collect(Collectors.toList())); } finally { lock.unlock(); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngine.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngine.java index 3332a5f1a5..0b2b346c2d 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngine.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngine.java @@ -65,7 +65,7 @@ public void reregistered(final SchedulerDriver schedulerDriver, final Protos.Mas @Override public void resourceOffers(final SchedulerDriver schedulerDriver, final List offers) { - for (Protos.Offer offer: offers) { + for (Protos.Offer offer : offers) { log.trace("Adding offer {} from host {}", offer.getId(), offer.getHostname()); LeasesQueue.getInstance().offer(offer); } @@ -83,7 +83,7 @@ public void statusUpdate(final SchedulerDriver schedulerDriver, final Protos.Tas TaskContext taskContext = TaskContext.from(taskId); String jobName = taskContext.getMetaInfo().getJobName(); log.trace("call statusUpdate task state is: {}, task id is: {}", taskStatus.getState(), taskId); - jobTracingEventBus.post(new JobStatusTraceEvent(jobName, taskContext.getId(), taskContext.getSlaveId(), JobStatusTraceEvent.Source.CLOUD_SCHEDULER, taskContext.getType().toString(), + jobTracingEventBus.post(new JobStatusTraceEvent(jobName, taskContext.getId(), taskContext.getSlaveId(), JobStatusTraceEvent.Source.CLOUD_SCHEDULER, taskContext.getType().toString(), String.valueOf(taskContext.getMetaInfo().getShardingItems()), JobStatusTraceEvent.State.valueOf(taskStatus.getState().name()), taskStatus.getMessage())); switch (taskStatus.getState()) { case TASK_RUNNING: diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledService.java index 3fada70b43..dc5014cea3 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledService.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledService.java @@ -107,7 +107,7 @@ protected void runOneIteration() { Collection vmAssignmentResults = taskScheduler.scheduleOnce(taskRequests, LeasesQueue.getInstance().drainTo()).getResultMap().values(); List taskContextsList = new LinkedList<>(); Map, List> offerIdTaskInfoMap = new HashMap<>(); - for (VMAssignmentResult each: vmAssignmentResults) { + for (VMAssignmentResult each : vmAssignmentResults) { List leasesUsed = each.getLeasesUsed(); List taskInfoList = new ArrayList<>(each.getTasksAssigned().size() * 10); taskInfoList.addAll(getTaskInfoList(launchingTasks.getIntegrityViolationJobs(vmAssignmentResults), each, leasesUsed.get(0).hostname(), leasesUsed.get(0).getOffer())); @@ -124,9 +124,9 @@ protected void runOneIteration() { for (Entry, List> each : offerIdTaskInfoMap.entrySet()) { schedulerDriver.launchTasks(each.getKey(), each.getValue()); } - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (Throwable throwable) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON log.error("Launch task error", throwable); } finally { AppConstraintEvaluator.getInstance().clearAppRunningState(); @@ -135,7 +135,7 @@ protected void runOneIteration() { private List getTaskInfoList(final Collection integrityViolationJobs, final VMAssignmentResult vmAssignmentResult, final String hostname, final Protos.Offer offer) { List result = new ArrayList<>(vmAssignmentResult.getTasksAssigned().size()); - for (TaskAssignmentResult each: vmAssignmentResult.getTasksAssigned()) { + for (TaskAssignmentResult each : vmAssignmentResult.getTasksAssigned()) { TaskContext taskContext = TaskContext.from(each.getTaskId()); String jobName = taskContext.getMetaInfo().getJobName(); if (!integrityViolationJobs.contains(jobName) && !facadeService.isRunning(taskContext) && !facadeService.isJobDisabled(jobName)) { @@ -257,7 +257,7 @@ private JobStatusTraceEvent createJobStatusTraceEvent(final TaskContext taskCont private List getOfferIDs(final List leasesUsed) { List result = new ArrayList<>(); - for (VirtualMachineLease virtualMachineLease: leasesUsed) { + for (VirtualMachineLease virtualMachineLease : leasesUsed) { result.add(virtualMachineLease.getOffer().getId()); } return result; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java index bb413f1d01..2643fbb4ea 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java @@ -48,7 +48,7 @@ public final class ProducerManager { private final CloudAppConfigurationService appConfigService; private final CloudJobConfigurationService configService; - + private final ReadyService readyService; private final RunningService runningService; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningService.java index 646f9a94cf..3a4b870b90 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningService.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningService.java @@ -65,14 +65,13 @@ public RunningService(final CoordinatorRegistryCenter regCenter) { */ public void start() { clear(); - List jobKeys = regCenter.getChildrenKeys(RunningNode.ROOT); - for (String each : jobKeys) { + for (String each : regCenter.getChildrenKeys(RunningNode.ROOT)) { if (!configurationService.load(each).isPresent()) { remove(each); continue; } - RUNNING_TASKS.put(each, Sets.newCopyOnWriteArraySet(regCenter.getChildrenKeys(RunningNode.getRunningJobNodePath(each)).stream().map( - input -> TaskContext.from(regCenter.get(RunningNode.getRunningTaskNodePath(MetaInfo.from(input).toString())))).collect(Collectors.toList()))); + RUNNING_TASKS.put(each, Sets.newCopyOnWriteArraySet(regCenter.getChildrenKeys(RunningNode.getRunningJobNodePath(each)).stream() + .map(input -> TaskContext.from(regCenter.get(RunningNode.getRunningTaskNodePath(MetaInfo.from(input).toString())))).collect(Collectors.toList()))); } } @@ -133,7 +132,7 @@ public void remove(final String jobName) { } regCenter.remove(RunningNode.getRunningJobNodePath(jobName)); } - + /** * Remove task from running queue. * diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java index 558607477d..407594586c 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java @@ -36,7 +36,7 @@ final class StatisticsScheduler { private final StdSchedulerFactory factory; private Scheduler scheduler; - + StatisticsScheduler() { factory = new StdSchedulerFactory(); try { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaData.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaData.java index 79c8f57d25..8444ae6fd8 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaData.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaData.java @@ -27,7 +27,7 @@ public final class TaskResultMetaData { private final AtomicInteger successCount; private final AtomicInteger failedCount; - + public TaskResultMetaData() { successCount = new AtomicInteger(0); failedCount = new AtomicInteger(0); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJob.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJob.java index 05bec99bfa..29f0b0a95d 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJob.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJob.java @@ -55,7 +55,7 @@ public final class JobRunningStatisticJob extends AbstractStatisticJob { private RunningService runningService; private StatisticRdbRepository repository; - + public JobRunningStatisticJob(final CoordinatorRegistryCenter registryCenter, final StatisticRdbRepository rdbRepository) { runningService = new RunningService(registryCenter); this.repository = rdbRepository; @@ -71,7 +71,8 @@ public Trigger buildTrigger() { return TriggerBuilder.newTrigger() .withIdentity(getTriggerName()) .withSchedule(CronScheduleBuilder.cronSchedule(EXECUTE_INTERVAL.getCron()) - .withMisfireHandlingInstructionDoNothing()).build(); + .withMisfireHandlingInstructionDoNothing()) + .build(); } @Override diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJob.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJob.java index c52493a7cf..814d883b36 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJob.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJob.java @@ -64,7 +64,8 @@ public Trigger buildTrigger() { return TriggerBuilder.newTrigger() .withIdentity(getTriggerName()) .withSchedule(CronScheduleBuilder.cronSchedule(execInterval.getCron()) - .withMisfireHandlingInstructionDoNothing()).build(); + .withMisfireHandlingInstructionDoNothing()) + .build(); } @Override diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJob.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJob.java index 445db8b121..65422fb6c8 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJob.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJob.java @@ -66,7 +66,8 @@ public Trigger buildTrigger() { return TriggerBuilder.newTrigger() .withIdentity(getTriggerName() + "_" + statisticInterval) .withSchedule(CronScheduleBuilder.cronSchedule(statisticInterval.getCron()) - .withMisfireHandlingInstructionDoNothing()).build(); + .withMisfireHandlingInstructionDoNothing()) + .build(); } @Override @@ -85,7 +86,7 @@ public void execute(final JobExecutionContext context) { TaskResultStatistics taskResultStatistics = new TaskResultStatistics( sharedData.getSuccessCount(), sharedData.getFailedCount(), statisticInterval, StatisticTimeUtils.getCurrentStatisticTime(statisticInterval)); - log.debug("Add taskResultStatistics, statisticInterval is:{}, successCount is:{}, failedCount is:{}", + log.debug("Add taskResultStatistics, statisticInterval is:{}, successCount is:{}, failedCount is:{}", statisticInterval, sharedData.getSuccessCount(), sharedData.getFailedCount()); repository.add(taskResultStatistics); sharedData.reset(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/ReflectionUtils.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/ReflectionUtils.java index c38cb4a7e3..5c35d9a2c2 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/ReflectionUtils.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/ReflectionUtils.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java index 2d7315acdc..c143b5165b 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java @@ -48,7 +48,7 @@ public final class JobEventRdbSearchTest { @Mock private PreparedStatement preparedStatement; - + // TODO We should not use `Mock.Strictness.LENIENT` here, but the default. This is a flaw in the unit test design. @Mock(strictness = Mock.Strictness.LENIENT) private ResultSet resultSet; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java index d9e39339c9..bbb076386e 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java index fb7cb50034..eb01b20109 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java @@ -58,7 +58,7 @@ public final class CloudJobConfigurationServiceTest { + "reconcileIntervalMinutes: 10\n" + "shardingItemParameters: ''\n" + "shardingTotalCount: 10\n"; - + @Mock private CoordinatorRegistryCenter regCenter; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java index 1fb00a26a6..e140d416cd 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java @@ -109,7 +109,7 @@ public void assertReconcileConfiguration() { assertThat(configuration.getReconcileIntervalMinutes(), is(0)); assertFalse(configuration.isEnabledReconcile()); } - + @Test public void assertGetMesosRole() { assertThat(bootstrapEnvironment.getMesosRole(), is(Optional.empty())); @@ -118,12 +118,12 @@ public void assertGetMesosRole() { ReflectionUtils.setFieldValue(bootstrapEnvironment, "properties", properties); assertThat(bootstrapEnvironment.getMesosRole(), is(Optional.of("0"))); } - + @Test public void assertGetFrameworkHostPort() { Properties properties = new Properties(); ReflectionUtils.setFieldValue(bootstrapEnvironment, "properties", properties); assertThat(bootstrapEnvironment.getFrameworkHostPort(), is("localhost:8899")); } - + } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppConfigurationBuilder.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppConfigurationBuilder.java index f414717920..3ce7b175e8 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppConfigurationBuilder.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppConfigurationBuilder.java @@ -24,7 +24,7 @@ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class CloudAppConfigurationBuilder { - + /** * Create cloud app configuration. * @param appName app name diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppJsonConstants.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppJsonConstants.java index efba518b35..9f34b87b59 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppJsonConstants.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppJsonConstants.java @@ -25,7 +25,7 @@ public final class CloudAppJsonConstants { private static final String APP_JSON = "{\"appName\":\"%s\",\"appURL\":\"http://localhost/app.jar\",\"bootstrapScript\":\"bin/start.sh\"," + "\"cpuCount\":1.0,\"memoryMB\":128.0,\"appCacheEnable\":true,\"eventTraceSamplingCount\":0}"; - + /** * Get app in json format. * @param appName app name diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJobConfigurationBuilder.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJobConfigurationBuilder.java index 6a84b4b8f1..34efe0e146 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJobConfigurationBuilder.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJobConfigurationBuilder.java @@ -61,7 +61,7 @@ public static CloudJobConfigurationPOJO createCloudJobConfiguration(final String * @return cloud job configuration */ public static CloudJobConfiguration createCloudJobConfiguration(final String jobName, final CloudJobExecutionType jobExecutionType, final int shardingTotalCount) { - return new CloudJobConfiguration("test_app", 1.0d, 128.0d, jobExecutionType, + return new CloudJobConfiguration("test_app", 1.0d, 128.0d, jobExecutionType, JobConfiguration.newBuilder(jobName, shardingTotalCount).cron("0/30 * * * * ?").failover(true).misfire(true).build()); } @@ -107,7 +107,7 @@ public static CloudJobConfigurationPOJO createOtherCloudJobConfiguration(final S * @return cloud job configuration */ public static CloudJobConfiguration createDataflowCloudJobConfiguration(final String jobName) { - return new CloudJobConfiguration("test_app", 1.0d, 128.0d, CloudJobExecutionType.TRANSIENT, + return new CloudJobConfiguration("test_app", 1.0d, 128.0d, CloudJobExecutionType.TRANSIENT, JobConfiguration.newBuilder(jobName, 3).cron("0/30 * * * * ?").failover(false).misfire(false).setProperty(DataflowJobProperties.STREAM_PROCESS_KEY, Boolean.TRUE.toString()).build()); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java index 5b15150b46..d15e60facc 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java @@ -36,11 +36,11 @@ public final class EmbedTestingServer { private static final int PORT = 10181; - + private static volatile TestingServer testingServer; - + private static final Object INIT_LOCK = new Object(); - + /** * Start embed zookeeper server. */ @@ -59,7 +59,7 @@ public static void start() { waitTestingServerReady(); } } - + private static void start0() { try { testingServer = new TestingServer(PORT, true); @@ -81,7 +81,7 @@ private static void start0() { })); } } - + private static void waitTestingServerReady() { int maxRetries = 60; try (CuratorFramework client = buildCuratorClient()) { @@ -107,7 +107,7 @@ private static void waitTestingServerReady() { } } } - + private static CuratorFramework buildCuratorClient() { CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); int retryIntervalMilliseconds = 500; @@ -119,11 +119,11 @@ private static CuratorFramework buildCuratorClient() { builder.connectionTimeoutMs(500); return builder.build(); } - + private static boolean isIgnoredException(final Throwable cause) { return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; } - + /** * Get the connection string. * @@ -133,4 +133,3 @@ public static String getConnectionString() { return "localhost:" + PORT; } } - diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TaskNode.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TaskNode.java index bb492ee687..f02337f4db 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TaskNode.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TaskNode.java @@ -41,9 +41,9 @@ public final class TaskNode { * @return task node path */ public String getTaskNodePath() { - return String.join(DELIMITER, null == jobName ? "test_job" : jobName, "" + shardingItem); + return String.join(DELIMITER, null == jobName ? "test_job" : jobName, String.valueOf(shardingItem)); } - + /** * Get task node value. * @return task node value @@ -51,7 +51,7 @@ public String getTaskNodePath() { public String getTaskNodeValue() { return String.join(DELIMITER, getTaskNodePath(), null == type ? ExecutionType.READY.toString() : type.toString(), null == slaveId ? "slave-S0" : slaveId, null == uuid ? "0" : uuid); } - + /** * Get task meta info. * @return meta info diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java index 7129fdf37e..c9d4a4d192 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java @@ -32,9 +32,9 @@ public final class JobTaskRequestTest { - private final JobTaskRequest jobTaskRequest = - new JobTaskRequest(new TaskContext("test_job", Collections.singletonList(0), ExecutionType - .READY, "unassigned-slave"), CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job").toCloudJobConfiguration()); + private final JobTaskRequest jobTaskRequest = + new JobTaskRequest(new TaskContext("test_job", Collections.singletonList(0), ExecutionType.READY, "unassigned-slave"), + CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job").toCloudJobConfiguration()); @Test public void assertGetId() { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java index d8e5f0854c..1d1e01044c 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java @@ -160,4 +160,3 @@ private void setReconcileEnabled(final boolean isEnabled) { when(env.getFrameworkConfiguration()).thenReturn(frameworkConfiguration); } } - diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java index dd78117c0d..3faa3f4b25 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java @@ -125,7 +125,7 @@ public void assertRunOneIterationWithScriptJob() { private TaskAssignmentResult mockTaskAssignmentResult(final String taskName, final ExecutionType executionType) { TaskAssignmentResult result = mock(TaskAssignmentResult.class); when(result.getTaskId()).thenReturn(String.format("%s@-@0@-@%s@-@unassigned-slave@-@0", taskName, executionType.name())); - return result; + return result; } @Test diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/OfferBuilder.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/OfferBuilder.java index 89bd71df9f..d6993ffeae 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/OfferBuilder.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/OfferBuilder.java @@ -23,7 +23,7 @@ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class OfferBuilder { - + /** * Create offer. * @param offerId offer id diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java index 982c0ba250..0b634254fa 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java @@ -64,7 +64,7 @@ public final class ProducerManagerTest { @Mock private CloudJobConfigurationService configService; - + @Mock private ReadyService readyService; @@ -84,7 +84,7 @@ public final class ProducerManagerTest { private final CloudJobConfigurationPOJO transientJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("transient_test_job"); private final CloudJobConfigurationPOJO daemonJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("daemon_test_job", CloudJobExecutionType.DAEMON); - + @BeforeEach public void setUp() { producerManager = new ProducerManager(schedulerDriver, regCenter); @@ -104,7 +104,7 @@ public void assertStartup() { verify(transientProducerScheduler).register(transientJobConfig); verify(readyService).addDaemon("daemon_test_job"); } - + @Test public void assertRegisterJobWithoutApp() { assertThrows(AppConfigurationException.class, () -> { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java index d3665ff472..a9ba189700 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java @@ -46,7 +46,7 @@ public final class TransientProducerSchedulerTest { @Mock private Scheduler scheduler; - + private TransientProducerScheduler transientProducerScheduler; private final CloudJobConfigurationPOJO cloudJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"); @@ -54,8 +54,9 @@ public final class TransientProducerSchedulerTest { private final JobDetail jobDetail = JobBuilder.newJob(TransientProducerScheduler.ProducerJob.class).withIdentity(cloudJobConfig.getCron()).build(); private final Trigger trigger = TriggerBuilder.newTrigger().withIdentity(cloudJobConfig.getCron()) - .withSchedule(CronScheduleBuilder.cronSchedule(cloudJobConfig.getCron()) - .withMisfireHandlingInstructionDoNothing()).build(); + .withSchedule(CronScheduleBuilder.cronSchedule(cloudJobConfig.getCron()) + .withMisfireHandlingInstructionDoNothing()) + .build(); @BeforeEach public void setUp() { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java index 46deb83616..f4c5bc4d84 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java @@ -36,7 +36,7 @@ public final class DisableAppServiceTest { private CoordinatorRegistryCenter regCenter; private DisableAppService disableAppService; - + @BeforeEach public void setUp() { disableAppService = new DisableAppService(regCenter); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java index 9a60982c01..b07513ae83 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java @@ -59,7 +59,7 @@ public final class ReadyServiceTest { private RunningService runningService; private ReadyService readyService; - + @BeforeEach public void setUp() { readyService = new ReadyService(regCenter); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java index 14e1af7c6f..e86db674c8 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java @@ -122,7 +122,7 @@ public void assertTaskResultStatisticsWhenRdbIsNotConfigured() { public void assertTaskResultStatisticsWhenRdbIsConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); when(rdbRepository.getSummedTaskResultStatistics(any(Date.class), any(StatisticInterval.class))) - .thenReturn(new TaskResultStatistics(10, 10, StatisticInterval.DAY, new Date())); + .thenReturn(new TaskResultStatistics(10, 10, StatisticInterval.DAY, new Date())); assertThat(statisticManager.getTaskResultStatisticsWeekly().getSuccessCount(), is(10)); assertThat(statisticManager.getTaskResultStatisticsWeekly().getFailedCount(), is(10)); assertThat(statisticManager.getTaskResultStatisticsSinceOnline().getSuccessCount(), is(10)); @@ -134,7 +134,7 @@ public void assertTaskResultStatisticsWhenRdbIsConfigured() { public void assertJobExecutionTypeStatistics() { ReflectionUtils.setFieldValue(statisticManager, "configurationService", configurationService); when(configurationService.loadAll()).thenReturn(Arrays.asList( - CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job_1", CloudJobExecutionType.DAEMON), + CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job_1", CloudJobExecutionType.DAEMON), CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job_2", CloudJobExecutionType.TRANSIENT))); assertThat(statisticManager.getJobExecutionTypeStatistics().getDaemonJobCount(), is(1)); assertThat(statisticManager.getJobExecutionTypeStatistics().getTransientJobCount(), is(1)); @@ -198,7 +198,7 @@ public void assertFindLatestTaskResultStatisticsWhenRdbIsConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); for (StatisticInterval each : StatisticInterval.values()) { when(rdbRepository.findLatestTaskResultStatistics(each)) - .thenReturn(Optional.of(new TaskResultStatistics(10, 5, each, new Date()))); + .thenReturn(Optional.of(new TaskResultStatistics(10, 5, each, new Date()))); TaskResultStatistics actual = statisticManager.findLatestTaskResultStatistics(each); assertThat(actual.getSuccessCount(), is(10)); assertThat(actual.getFailedCount(), is(5)); @@ -216,7 +216,7 @@ public void assertFindTaskResultStatisticsDailyWhenRdbIsNotConfigured() { public void assertFindTaskResultStatisticsDailyWhenRdbIsConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); when(rdbRepository.findTaskResultStatistics(any(Date.class), any(StatisticInterval.class))) - .thenReturn(Collections.singletonList(new TaskResultStatistics(10, 5, StatisticInterval.MINUTE, new Date()))); + .thenReturn(Collections.singletonList(new TaskResultStatistics(10, 5, StatisticInterval.MINUTE, new Date()))); assertThat(statisticManager.findTaskResultStatisticsDaily().size(), is(1)); verify(rdbRepository).findTaskResultStatistics(any(Date.class), any(StatisticInterval.class)); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java index 3477a731ea..8047204227 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java @@ -52,5 +52,5 @@ public void assertReset() { assertThat(metaData.getSuccessCount(), is(0)); assertThat(metaData.getFailedCount(), is(0)); } - + } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java index 78fe5f9a6d..f732f2a909 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java @@ -55,5 +55,5 @@ public void assertFindBlankStatisticTimes() { } } } - + } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TestStatisticJob.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TestStatisticJob.java index b25d7cbef5..f8513315b2 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TestStatisticJob.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TestStatisticJob.java @@ -40,7 +40,8 @@ public Trigger buildTrigger() { return TriggerBuilder.newTrigger() .withIdentity(getTriggerName()) .withSchedule(CronScheduleBuilder.cronSchedule(StatisticInterval.MINUTE.getCron()) - .withMisfireHandlingInstructionDoNothing()).build(); + .withMisfireHandlingInstructionDoNothing()) + .build(); } @Override diff --git a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml index 38abef0617..8984517ce3 100644 --- a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml @@ -60,10 +60,10 @@ cloud-bin - package single + package src/main/assembly/elasticjob-cloud-binary-distribution.xml diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml index 7e2a65c7ef..978cb225ce 100644 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml @@ -15,7 +15,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 @@ -142,17 +142,15 @@ maven-assembly-plugin - - src/main/assembly/elasticjob-cloud-scheduler-binary-distribution.xml - + src/main/assembly/elasticjob-cloud-scheduler-binary-distribution.xml - package single + package @@ -170,6 +168,13 @@ com.spotify dockerfile-maven-plugin + + apache/shardingsphere-elasticjob-cloud-scheduler + ${project.version} + + ${project.build.finalName}-cloud-scheduler-bin + + cloud-scheduler-bin @@ -178,13 +183,6 @@ - - apache/shardingsphere-elasticjob-cloud-scheduler - ${project.version} - - ${project.build.finalName}-cloud-scheduler-bin - - diff --git a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml index 485fabb115..fa4034102b 100644 --- a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml @@ -70,10 +70,10 @@ lite-bin - package single + package src/main/assembly/elasticjob-lite-binary-distribution.xml diff --git a/elasticjob-distribution/elasticjob-src-distribution/pom.xml b/elasticjob-distribution/elasticjob-src-distribution/pom.xml index 5eb0c3ffa0..5cdeb9c356 100644 --- a/elasticjob-distribution/elasticjob-src-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-src-distribution/pom.xml @@ -37,10 +37,10 @@ src - package single + package src/main/assembly/source-distribution.xml diff --git a/elasticjob-distribution/pom.xml b/elasticjob-distribution/pom.xml index be5f997bab..eba35b5202 100644 --- a/elasticjob-distribution/pom.xml +++ b/elasticjob-distribution/pom.xml @@ -27,14 +27,14 @@ pom ${project.artifactId} - - true - - elasticjob-src-distribution elasticjob-lite-distribution elasticjob-cloud-executor-distribution elasticjob-cloud-scheduler-distribution + + + true + diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java index 95f85d9e0a..1b9f67fb3b 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml index e90ceb4cf9..7da18a0949 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml @@ -48,7 +48,7 @@ com.sun.mail javax.mail - + ch.qos.logback logback-classic diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java index eddfa5da58..5d48b4b6f8 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java @@ -93,7 +93,7 @@ private Properties createSessionProperties(final String host, final int port, fi private Authenticator getSessionAuthenticator(final String username, final String password) { return new Authenticator() { - + @Override public PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password); @@ -116,7 +116,7 @@ public void handleException(final String jobName, final Throwable cause) { private String getErrorMessage(final String jobName, final Throwable cause) { StringWriter writer = new StringWriter(); cause.printStackTrace(new PrintWriter(writer, true)); - return String.format("Job '%s' exception occur in job processing, caused by %s", jobName, writer.toString()); + return String.format("Job '%s' exception occur in job processing, caused by %s", jobName, writer); } private Message createMessage(final String content) throws MessagingException { diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml index 9184609e4a..1f823ad4e9 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml @@ -41,12 +41,12 @@ org.slf4j slf4j-api - + org.projectlombok lombok - + ch.qos.logback logback-classic diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java index 363573c2ff..5e77909bc5 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java index d6d9521087..5eaab152de 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java index 2311b69dc3..2d98f0f454 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java index 7d763724b8..ffa3299405 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java index 7bf5b15b50..c81f994dc4 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -37,8 +37,7 @@ public void assertGetDefaultHandler() { @Test public void assertGetInvalidHandler() { - assertThrows(JobConfigurationException.class, () -> - JobErrorHandlerFactory.createHandler("INVALID", new Properties()).orElseThrow(() -> new JobConfigurationException(""))); + assertThrows(JobConfigurationException.class, () -> JobErrorHandlerFactory.createHandler("INVALID", new Properties()).orElseThrow(() -> new JobConfigurationException(""))); } @Test diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java index 3318cafcc0..054ec2437c 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -27,7 +27,7 @@ public final class IgnoreJobErrorHandlerTest { @Test public void assertHandleException() { - JobErrorHandlerFactory.createHandler("IGNORE", new Properties()).orElseThrow( - () -> new JobConfigurationException("IGNORE error handler not found.")).handleException("test_job", new RuntimeException("test")); + JobErrorHandlerFactory.createHandler("IGNORE", new Properties()) + .orElseThrow(() -> new JobConfigurationException("IGNORE error handler not found.")).handleException("test_job", new RuntimeException("test")); } } diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java index a76aa3da5b..d487643763 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java index 7a8b0bbb1c..86b1ac5504 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -27,11 +27,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; public final class ThrowJobErrorHandlerTest { - + @Test public void assertHandleException() { - assertThrows(JobSystemException.class, () -> - JobErrorHandlerFactory.createHandler("THROW", new Properties()).orElseThrow(() -> - new JobConfigurationException("THROW error handler not found.")).handleException("test_job", new RuntimeException("test"))); + assertThrows(JobSystemException.class, () -> JobErrorHandlerFactory.createHandler("THROW", new Properties()).orElseThrow(() -> new JobConfigurationException("THROW error handler not found.")) + .handleException("test_job", new RuntimeException("test"))); } } diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java index 6a879be4f1..b43cc29764 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -92,9 +92,9 @@ public void execute() { } try { jobFacade.beforeJobExecuted(shardingContexts); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Throwable cause) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON jobErrorHandler.handleException(jobConfig.getJobName(), cause); } execute(jobConfig, shardingContexts, ExecutionSource.NORMAL_TRIGGER); @@ -105,9 +105,9 @@ public void execute() { jobFacade.failoverIfNecessary(); try { jobFacade.afterJobExecuted(shardingContexts); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Throwable cause) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON jobErrorHandler.handleException(jobConfig.getJobName(), cause); } } diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java index 03fb1c6ac6..40b2cda64f 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java index f95d40dbb7..39c249e0ca 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java index d2792d1a39..4d4ed138ff 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java index dd77a904b7..1627f6967d 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java index b2f0542638..fba87a4d6a 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java index d8ee2974ea..46628780c6 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -101,7 +101,7 @@ public void assertExecuteWhenPreviousJobStillRunning() { when(jobFacade.misfireIfRunning(shardingContexts.getShardingItemParameters().keySet())).thenReturn(true); elasticJobExecutor.execute(); verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_STAGING, "Job 'test_job' execute begin."); - verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_FINISHED, + verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_FINISHED, "Previous job 'test_job' - shardingItems '[]' is still running, misfired job will start after previous job completed."); verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); } @@ -115,7 +115,7 @@ public void assertExecuteWhenShardingItemsIsEmpty() { verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_FINISHED, "Sharding item for job 'test_job' is empty."); verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); } - + @Test public void assertExecuteFailureWhenThrowExceptionForSingleShardingItem() { assertThrows(JobSystemException.class, () -> assertExecuteFailureWhenThrowException(createSingleShardingContexts())); diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java index c5299c6624..e5554dcd29 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java index 25c21d455e..3e46cbf9b0 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java index 0cd62dfd0d..c0101e7f53 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java index 6657d93560..ad2deef881 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java index edfaf113d2..006a07a848 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java index 7bacb85b86..08c0fe09b6 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -33,8 +33,7 @@ public final class JobItemExecutorFactoryTest { @Test public void assertGetExecutorByClassFailureWithInvalidType() { - assertThrows(JobConfigurationException.class, () -> - JobItemExecutorFactory.getExecutor(FailedJob.class)); + assertThrows(JobConfigurationException.class, () -> JobItemExecutorFactory.getExecutor(FailedJob.class)); } @Test @@ -49,8 +48,7 @@ public void assertGetExecutorByClassSuccessWithSubClass() { @Test public void assertGetExecutorByTypeFailureWithInvalidType() { - assertThrows(JobConfigurationException.class, () -> - JobItemExecutorFactory.getExecutor("FAIL")); + assertThrows(JobConfigurationException.class, () -> JobItemExecutorFactory.getExecutor("FAIL")); } @Test diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java index 0de47005de..2eea1de495 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java index 486fdbf27e..f88e52383c 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java index 4aed5460d0..9da5aaefe5 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml index 65ff59805b..43dd477f17 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml @@ -32,7 +32,7 @@ elasticjob-executor-kernel ${project.parent.version} - + org.apache.shardingsphere.elasticjob elasticjob-restful @@ -45,12 +45,12 @@ lombok provided - + org.slf4j slf4j-jdk14 - true test + true org.awaitility diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java index 29d37f6e15..2d6b4c9c69 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java @@ -61,7 +61,7 @@ public final class HttpJobExecutorTest { @Mock private JobFacade jobFacade; - + // TODO We should not use `Mock.Strictness.LENIENT` here, but the default. This is a flaw in the unit test design. @Mock(strictness = Mock.Strictness.LENIENT) private Properties properties; diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java index 16d56c19c9..e94d88d4a1 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java @@ -75,9 +75,7 @@ public String postName(@Param(name = "updateName", source = ParamSource.PATH) fi */ @Mapping(method = Http.POST, path = "/postWithTimeout") public String postWithTimeout() { - Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.SECONDS).untilAsserted(() -> - assertThat(Boolean.TRUE, is(Boolean.TRUE)) - ); + Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.SECONDS).untilAsserted(() -> assertThat(Boolean.TRUE, is(Boolean.TRUE))); return "ejob"; } } diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java index 781790754d..2051d70f6f 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java index ff3137f47a..94fca9e86d 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java index d6e7366a8f..3f3a9dfdd7 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java @@ -87,15 +87,15 @@ public void assertProcess() { when(properties.getProperty(ScriptJobProperties.SCRIPT_KEY)).thenReturn(determineCommandByPlatform()); jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); } - + private String determineCommandByPlatform() { return OS.isFamilyWindows() ? getWindowsEcho() : getEcho(); } - + private String getWindowsEcho() { return "cmd /c echo script-job"; } - + private String getEcho() { return "echo script-job"; } diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java index d6f6c8e85b..2423eddd8b 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java index a414cd9b07..787dd9d6a5 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java index 72e24a95b5..963aa69a45 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml index a549e4f6f5..f1745faebe 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml @@ -56,7 +56,7 @@ org.projectlombok lombok - + org.slf4j jcl-over-slf4j diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java index 46df6e47ef..8f39d39ca6 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -37,13 +37,13 @@ */ @Slf4j public final class JobTracingEventBus { - + private static final ExecutorService EXECUTOR_SERVICE; private final EventBus eventBus; private volatile boolean isRegistered; - + static { EXECUTOR_SERVICE = createExecutorService(Runtime.getRuntime().availableProcessors() * 2); } @@ -58,7 +58,7 @@ public JobTracingEventBus(final TracingConfiguration tracingConfig) { } private static ExecutorService createExecutorService(final int threadSize) { - ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(threadSize, threadSize, 5L, TimeUnit.MINUTES, + ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(threadSize, threadSize, 5L, TimeUnit.MINUTES, new LinkedBlockingQueue<>(), new BasicThreadFactory.Builder().namingPattern(String.join("-", "job-event", "%s")).build()); threadPoolExecutor.allowCoreThreadTimeOut(true); return MoreExecutors.listeningDecorator(MoreExecutors.getExitingExecutorService(threadPoolExecutor)); diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java index 1c504a789b..46b0efdfe1 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java index 3b7324eab1..68f2241670 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java index 1f95531b46..183c34aff1 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java index 9a1b679e66..3e1a286039 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java index 89f8a1521d..067e82cd1a 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java index 414ddeb9f1..b9ac000265 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java index eb3b2f251b..3fbb124e09 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java index d088728816..f4c451cee0 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java index b8a5d1f759..b85cc30a46 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java index e14a49cf7b..7a10039fe1 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java index 99d0cad5c2..1d454862bb 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java index ed824c8e60..7f6cfdf40c 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java index 48f09f0225..d29b840f2a 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java index c950d22c71..d87fb5e432 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java index 56fa18eeca..c284f5e553 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -31,14 +31,12 @@ public final class TracingListenerFactoryTest { @Test public void assertGetListenerWithNullType() { - assertThrows(TracingConfigurationException.class, () -> - TracingListenerFactory.getListener(new TracingConfiguration<>("", null))); + assertThrows(TracingConfigurationException.class, () -> TracingListenerFactory.getListener(new TracingConfiguration<>("", null))); } - + @Test public void assertGetInvalidListener() { - assertThrows(TracingConfigurationException.class, () -> - TracingListenerFactory.getListener(new TracingConfiguration<>("INVALID", null))); + assertThrows(TracingConfigurationException.class, () -> TracingListenerFactory.getListener(new TracingConfiguration<>("INVALID", null))); } @Test diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java index 1c2c712da1..4f31edb5f1 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java @@ -36,6 +36,6 @@ public void assertConverterNotFound() { } private static class AClassWithoutCorrespondingConverter { - + } } diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml index cd04ba62d5..c9ff6ba2dd 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml @@ -37,7 +37,7 @@ org.projectlombok lombok - + org.slf4j jcl-over-slf4j diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java index 3c518e8382..87b4a907bd 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java index f6747e5235..397f78c338 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java index 8c27715f0f..be6f2d310c 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -58,28 +58,28 @@ public final class RDBJobEventStorage { private static final String TASK_ID_STATE_INDEX = "TASK_ID_STATE_INDEX"; private static final Map DATABASE_TYPES = new HashMap<>(); - + private static final Map STORAGE_MAP = new ConcurrentHashMap<>(); - + private final DataSource dataSource; - + private final DatabaseType databaseType; - + private final RDBStorageSQLMapper sqlMapper; - + static { for (DatabaseType each : ServiceLoader.load(DatabaseType.class)) { DATABASE_TYPES.put(each.getType(), each); } } - + private RDBJobEventStorage(final DataSource dataSource) throws SQLException { this.dataSource = dataSource; databaseType = getDatabaseType(dataSource); sqlMapper = new RDBStorageSQLMapper(databaseType.getSQLPropertiesFile()); initTablesAndIndexes(); } - + /** * The same dataSource always return the same RDBJobEventStorage instance. * @@ -96,7 +96,7 @@ public static RDBJobEventStorage getInstance(final DataSource dataSource) throws } })); } - + /** * WrapException util method. * @@ -114,7 +114,7 @@ public static RDBJobEventStorage wrapException(final Supplier - new RDBTracingListenerConfiguration().createTracingListener(new BasicDataSource())); + assertThrows(TracingConfigurationException.class, () -> new RDBTracingListenerConfiguration().createTracingListener(new BasicDataSource())); } } diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java index 3f67f4f355..0a41349898 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java index ce708f28a1..5fc5c40848 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -39,7 +39,7 @@ public final class RDBJobEventStorageTest { private RDBJobEventStorage storage; - + private BasicDataSource dataSource; @BeforeEach @@ -56,7 +56,7 @@ public void setup() throws SQLException { public void teardown() throws SQLException { dataSource.close(); } - + @Test public void assertAddJobExecutionEvent() { assertTrue(storage.addJobExecutionEvent(new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0))); @@ -137,7 +137,7 @@ public void assertUpdateJobExecutionEventWhenFailureAndMessageExceed() { for (int i = 0; i < 600; i++) { failureMsg.append(i); } - JobExecutionEvent failEvent = startEvent.executionFailure("java.lang.RuntimeException: failure" + failureMsg.toString()); + JobExecutionEvent failEvent = startEvent.executionFailure("java.lang.RuntimeException: failure" + failureMsg); assertTrue(storage.addJobExecutionEvent(failEvent)); assertThat(failEvent.getFailureCause(), startsWith("java.lang.RuntimeException: failure")); } diff --git a/elasticjob-infra/elasticjob-infra-common/pom.xml b/elasticjob-infra/elasticjob-infra-common/pom.xml index f352732a2c..4314358467 100644 --- a/elasticjob-infra/elasticjob-infra-common/pom.xml +++ b/elasticjob-infra/elasticjob-infra-common/pom.xml @@ -59,7 +59,7 @@ org.projectlombok lombok - + org.slf4j jcl-over-slf4j diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java index 6cce9c23f5..25f3139b2d 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java index 689dbe3272..90f91e908b 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -50,7 +50,7 @@ public ElasticJobExecutorService(final String namingPattern, final int threadSiz public ExecutorService createExecutorService() { return MoreExecutors.listeningDecorator(MoreExecutors.getExitingExecutorService(threadPoolExecutor)); } - + /** * Whether the threadPoolExecutor has been shut down. * diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java index 2f411c4ca8..31de960583 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java @@ -40,14 +40,16 @@ public final class ExecutorServiceReloadable implements Reloadable shardingItems; - + /** * Get task meta data info via string. * @@ -144,7 +144,8 @@ public static MetaInfo from(final String value) { String[] result = value.split(DELIMITER); Preconditions.checkState(1 == result.length || 2 == result.length || 5 == result.length); return new MetaInfo(result[0], 1 == result.length || "".equals(result[1]) - ? Collections.emptyList() : Splitter.on(",").splitToList(result[1]).stream().map(Integer::parseInt).collect(Collectors.toList())); + ? Collections.emptyList() + : Splitter.on(",").splitToList(result[1]).stream().map(Integer::parseInt).collect(Collectors.toList())); } @Override diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java index 785318b8a2..56e1423199 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java index 42acc700d6..c5ddbefe5a 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java index a98c6d5fc2..77236d6e33 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java index 0b5676ef40..7a127b60d5 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java index d7642865c8..dc8bcee988 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java index de3ea67719..95245b9f72 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java index 3fea412e07..d4093ccdb2 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java index 402fcf9e59..914540e30b 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java index d3abc88330..70e4b704a6 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java index ee40bf186f..628e0f43e0 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java index 6afcb56a45..3e2bcc2c2b 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java index 907fd235af..d96803340a 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -31,7 +31,6 @@ * IP address asc if job name' hashcode is odd; * IP address desc if job name' hashcode is even. * Used to average assign to job server. - * * For example: * 1. If there are 3 job servers with 2 sharding item, and the hash value of job name is odd, then each server is divided into: 1 = [0], 2 = [1], 3 = []; * 2. If there are 3 job servers with 2 sharding item, and the hash value of job name is even, then each server is divided into: 3 = [0], 2 = [1], 1 = []. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java index a3cb679d53..182f63ccda 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java index 1e095aea4b..39c1f642a5 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java index 1cc14948ac..839c7baffd 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java index 840370cb38..f28d060ffa 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java index 37ed03ce23..959f84505b 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java index 9dac2197ac..c81e2d3730 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java index 8b3a21096e..dc7b2f8f55 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java @@ -65,7 +65,7 @@ public static Gson getGson() { public static JsonParser getJsonParser() { return JSON_PARSER; } - + /** * Re-initialize the GsonBuilder. */ diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java index f16e784b80..4fc1b249d8 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,7 +23,7 @@ * ElasticJob listener. */ public interface ElasticJobListener extends TypedSPI { - + int LOWEST = Integer.MAX_VALUE; /** @@ -39,7 +39,7 @@ public interface ElasticJobListener extends TypedSPI { * @param shardingContexts sharding contexts */ void afterJobExecuted(ShardingContexts shardingContexts); - + /** * Listener order, default is the lowest. * @return order diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java index f166e81e36..b5aab2459a 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java index 85ab86191f..50fef3a0af 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java index 501cad3b3e..e322e94d1c 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java index 233f9ff304..aa13ff780a 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java @@ -27,6 +27,7 @@ * ElasticJob YAML representer. */ public final class ElasticJobYamlRepresenter extends Representer { + public ElasticJobYamlRepresenter(final DumperOptions options) { super(options); } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java index 3db5903723..47b990a437 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -31,7 +31,7 @@ public final class ElasticJobExecutorServiceTest { private static boolean hasExecuted; - + @Test public void assertCreateExecutorService() { ElasticJobExecutorService executorServiceObject = new ElasticJobExecutorService("executor-service-test", 1); @@ -58,7 +58,7 @@ public void assertCreateExecutorService() { } static class FooTask implements Runnable { - + @Override public void run() { Awaitility.await().atMost(1L, TimeUnit.MINUTES) diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java index ee6b5bc620..040e44b06b 100755 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java index 93803aa430..c65a15f749 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java index 8e9a87d0bc..94202fb856 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -43,6 +43,6 @@ public String getTaskNodeValue() { } private String getTaskNodePath() { - return String.join("@-@", null == jobName ? "test_job" : jobName, shardingItem + ""); + return String.join("@-@", null == jobName ? "test_job" : jobName, String.valueOf(shardingItem)); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java index 45d1e478e4..fc91f356aa 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java index d2ea13281e..d88adb03df 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java index 55341edc51..d48b5c87b9 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java index 2d585f41e9..d42f12baf1 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java index c94cecd137..0af136a9e3 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java index 24c4bd19b4..7b69ba07ce 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java index 5e08bc50c9..0b904b655e 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java index 4596f0da32..5b83660c08 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java index 1cd13ae37d..2bbc181d50 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java index 11a516c001..bbf9888d67 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -35,8 +35,7 @@ public void assertGetDefaultStrategy() { @Test public void assertGetInvalidStrategy() { - assertThrows(JobConfigurationException.class, () -> - JobShardingStrategyFactory.getStrategy("INVALID")); + assertThrows(JobConfigurationException.class, () -> JobShardingStrategyFactory.getStrategy("INVALID")); } @Test diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java index 9d6525f7a9..e4b01e232d 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java index b651b1f542..009078818a 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java index e1709e9ab6..aa081a4537 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java index 863cd9860e..b5f921c016 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -35,8 +35,7 @@ public void assertGetDefaultHandler() { @Test public void assertGetInvalidHandler() { - assertThrows(JobConfigurationException.class, () -> - JobExecutorServiceHandlerFactory.getHandler("INVALID")); + assertThrows(JobConfigurationException.class, () -> JobExecutorServiceHandlerFactory.getHandler("INVALID")); } @Test diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java index 23fc1a90e7..51d83b2011 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java @@ -76,4 +76,3 @@ public void assertParserWithException() { }); } } - diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java index f00a68bc87..4e0333e0d7 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java @@ -29,8 +29,7 @@ public final class ElasticJobListenerFactoryTest { @Test public void assertCreateInvalidJobListener() { - assertThrows(JobConfigurationException.class, () -> - ElasticJobListenerFactory.createListener("INVALID").orElseThrow(() -> new JobConfigurationException("Invalid elastic job listener!"))); + assertThrows(JobConfigurationException.class, () -> ElasticJobListenerFactory.createListener("INVALID").orElseThrow(() -> new JobConfigurationException("Invalid elastic job listener!"))); } @Test diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java index 8eb20c5af0..91375ad711 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java index 5f19fb6cc8..f53ce97d25 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java @@ -25,7 +25,7 @@ public final class FooElasticJobListener implements ElasticJobListener { @Override public void beforeJobExecuted(final ShardingContexts shardingContexts) { } - + @Override public void afterJobExecuted(final ShardingContexts shardingContexts) { } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java index 1fbdf14b07..4e8493abc0 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java index fb0ad8b5cd..350ce60876 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java @@ -47,25 +47,25 @@ public void assertNewTypedServiceInstance() { @Test public void assertGetCacheTypedServiceFailureWithUnRegisteredServiceInterface() { - Assertions.assertThrows(IllegalArgumentException.class, () -> - ElasticJobServiceLoader.getCachedTypedServiceInstance(UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl").orElseThrow(IllegalArgumentException::new)); + Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader.getCachedTypedServiceInstance( + UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl").orElseThrow(IllegalArgumentException::new)); } @Test public void assertGetCacheTypedServiceFailureWithInvalidType() { - Assertions.assertThrows(IllegalArgumentException.class, () -> - ElasticJobServiceLoader.getCachedTypedServiceInstance(TypedFooService.class, "INVALID").orElseThrow(IllegalArgumentException::new)); + Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader.getCachedTypedServiceInstance( + TypedFooService.class, "INVALID").orElseThrow(IllegalArgumentException::new)); } @Test public void assertNewTypedServiceInstanceFailureWithUnRegisteredServiceInterface() { - Assertions.assertThrows(IllegalArgumentException.class, () -> - ElasticJobServiceLoader.newTypedServiceInstance(UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl", new Properties()).orElseThrow(IllegalArgumentException::new)); + Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader + .newTypedServiceInstance(UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl", new Properties()).orElseThrow(IllegalArgumentException::new)); } @Test public void assertNewTypedServiceInstanceFailureWithInvalidType() { - Assertions.assertThrows(IllegalArgumentException.class, () -> - ElasticJobServiceLoader.newTypedServiceInstance(TypedFooService.class, "INVALID", new Properties()).orElseThrow(IllegalArgumentException::new)); + Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader.newTypedServiceInstance( + TypedFooService.class, "INVALID", new Properties()).orElseThrow(IllegalArgumentException::new)); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java index 89159cff06..5ed5219bb1 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java index f17010441f..32891da473 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java index 385714774c..02fef28610 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java index a0e1401b2c..c53e043b17 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,7 +20,7 @@ import org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService; public final class UnRegisteredTypedFooServiceImpl implements UnRegisteredTypedFooService { - + @Override public String getType() { return "unRegisteredTypedFooServiceImpl"; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java index 7c02c0ea57..0de1734828 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java @@ -29,6 +29,6 @@ public void assertConverterNotFound() { } private static class AClassWithoutCorrespondingConverter { - + } } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml index 6819cb1324..e89073a229 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml @@ -17,15 +17,15 @@ --> + 4.0.0 - elasticjob-registry-center org.apache.shardingsphere.elasticjob + elasticjob-registry-center 3.1.0-SNAPSHOT - 4.0.0 elasticjob-registry-center-api ${project.artifactId} - + org.slf4j diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java index 574601406f..8785c1acb3 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -123,7 +123,7 @@ public interface CoordinatorRegistryCenter extends RegistryCenter { * @param listener connection state changed event listener */ void addConnectionStateChangedEventListener(String key, ConnectionStateChangedEventListener listener); - + /** * Execute operations in transaction. * @@ -131,13 +131,13 @@ public interface CoordinatorRegistryCenter extends RegistryCenter { * @throws Exception exception */ void executeInTransaction(List transactionOperations) throws Exception; - + /** * Remove all data listeners that have been bound to the current key. * @param key key to be watched */ void removeDataListeners(String key); - + /** * Remove conn state listener that have been bound to the current key. * @param key key to be watched diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java index c0d0ad6184..5d2987a26f 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java index 701572f81e..e9c1e31de2 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java index 1254f91987..229d60d4b5 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java index 20f4f0751f..2100a0fd49 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java index 9488c8646b..dc268358c5 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java @@ -27,9 +27,9 @@ public interface ConnectionStateChangedEventListener { enum State { CONNECTED, - + RECONNECTED, - + UNAVAILABLE, } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java index 334f8a6acf..65ca4a1a7a 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java @@ -21,7 +21,7 @@ * Data changed listener. */ public interface DataChangedEventListener { - + /** * Fire when data changed. * diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java index e619bf325b..01c0e1e575 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml index 58210f29e2..8685723b4a 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml @@ -17,22 +17,22 @@ --> + 4.0.0 - elasticjob-regitry-center-provider org.apache.shardingsphere.elasticjob + elasticjob-regitry-center-provider 3.1.0-SNAPSHOT - 4.0.0 elasticjob-registry-center-zookeeper-curator ${project.artifactId} - + org.apache.shardingsphere.elasticjob elasticjob-registry-center-api ${project.parent.version} - + org.apache.curator curator-framework @@ -45,12 +45,12 @@ org.apache.curator curator-recipes - + org.projectlombok lombok - + org.apache.curator curator-test @@ -71,5 +71,5 @@ test - + diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java index ac4186e04e..056ea9a7b8 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -74,17 +74,17 @@ public final class ZookeeperRegistryCenter implements CoordinatorRegistryCenter private final ZookeeperConfiguration zkConfig; private final Map caches = new ConcurrentHashMap<>(); - + /** * Data listener list. */ private final Map> dataListeners = new ConcurrentHashMap<>(); - + /** * Connections state listener list. */ private final Map> connStateListeners = new ConcurrentHashMap<>(); - + @Getter private CuratorFramework client; @@ -108,12 +108,12 @@ public void init() { if (!Strings.isNullOrEmpty(zkConfig.getDigest())) { builder.authorization("digest", zkConfig.getDigest().getBytes(StandardCharsets.UTF_8)) .aclProvider(new ACLProvider() { - + @Override public List getDefaultAcl() { return ZooDefs.Ids.CREATOR_ALL_ACL; } - + @Override public List getAclForPath(final String path) { return ZooDefs.Ids.CREATOR_ALL_ACL; @@ -127,9 +127,9 @@ public List getAclForPath(final String path) { client.close(); throw new KeeperException.OperationTimeoutException(); } - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } } @@ -144,9 +144,7 @@ public void close() { } /* - * // TODO - * sleep 500ms, let cache client close first and then client, otherwise will throw exception - * reference:https://issues.apache.org/jira/browse/CURATOR-157 + * // TODO sleep 500ms, let cache client close first and then client, otherwise will throw exception reference:https://issues.apache.org/jira/browse/CURATOR-157 */ private void waitForCacheClose() { try { @@ -179,9 +177,9 @@ private CuratorCache findCuratorCache(final String key) { public String getDirectly(final String key) { try { return new String(client.getData().forPath(key), StandardCharsets.UTF_8); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); return null; } @@ -193,9 +191,9 @@ public List getChildrenKeys(final String key) { List result = client.getChildren().forPath(key); result.sort(Comparator.reverseOrder()); return result; - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); return Collections.emptyList(); } @@ -208,21 +206,21 @@ public int getNumChildren(final String key) { if (null != stat) { return stat.getNumChildren(); } - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } return 0; } - + @Override public boolean isExisted(final String key) { try { return null != client.checkExists().forPath(key); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); return false; } @@ -236,9 +234,9 @@ public void persist(final String key, final String value) { } else { update(key, value); } - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } } @@ -248,9 +246,9 @@ public void update(final String key, final String value) { try { TransactionOp transactionOp = client.transactionOp(); client.transaction().forOperations(transactionOp.check().forPath(key), transactionOp.setData().forPath(key, value.getBytes(StandardCharsets.UTF_8))); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } } @@ -262,9 +260,9 @@ public void persistEphemeral(final String key, final String value) { client.delete().deletingChildrenIfNeeded().forPath(key); } client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL).forPath(key, value.getBytes(StandardCharsets.UTF_8)); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } } @@ -273,9 +271,9 @@ public void persistEphemeral(final String key, final String value) { public String persistSequential(final String key, final String value) { try { return client.create().creatingParentsIfNeeded().withMode(CreateMode.PERSISTENT_SEQUENTIAL).forPath(key, value.getBytes(StandardCharsets.UTF_8)); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } return null; @@ -285,9 +283,9 @@ public String persistSequential(final String key, final String value) { public void persistEphemeralSequential(final String key) { try { client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).forPath(key); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } } @@ -296,9 +294,9 @@ public void persistEphemeralSequential(final String key) { public void remove(final String key) { try { client.delete().deletingChildrenIfNeeded().forPath(key); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } } @@ -309,9 +307,9 @@ public long getRegistryCenterTime(final String key) { try { persist(key, ""); result = client.checkExists().forPath(key).getMtime(); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } Preconditions.checkState(0L != result, "Cannot get registry center time."); @@ -378,9 +376,9 @@ private CuratorOp toCuratorOp(final TransactionOperation each, final Transaction default: throw new UnsupportedOperationException(each.toString()); } - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON throw new RegException(ex); } } @@ -390,9 +388,9 @@ public void addCacheData(final String cachePath) { CuratorCache cache = CuratorCache.build(client, cachePath); try { cache.start(); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } caches.put(cachePath + "/", cache); @@ -417,9 +415,9 @@ public void executeInLeader(final String key, final LeaderExecutionCallback call latch.start(); latch.await(); callback.execute(); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON handleException(ex); } } @@ -446,7 +444,7 @@ public void watch(final String key, final DataChangedEventListener listener, fin } dataListeners.computeIfAbsent(key, k -> new LinkedList<>()).add(cacheListener); } - + @Override public void removeDataListeners(final String key) { final CuratorCache cache = caches.get(key + "/"); @@ -460,7 +458,7 @@ public void removeDataListeners(final String key) { } cacheListenerList.forEach(listener -> cache.listenable().removeListener(listener)); } - + @Override public void removeConnStateListener(final String key) { final List listenerList = connStateListeners.remove(key); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java index 360ca6580b..85b006226e 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java @@ -29,7 +29,7 @@ * Zookeeper curator ignored exception provider. */ public final class ZookeeperCuratorIgnoredExceptionProvider implements IgnoredExceptionProvider { - + @Override public Collection> getIgnoredExceptions() { return Arrays.asList(ConnectionLossException.class, NoNodeException.class, NodeExistsException.class); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java index 4b11d653b4..f02943e254 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java index 826ec40096..5edb311d47 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -83,12 +83,12 @@ private void blockUntilCondition(final Supplier condition) { Thread.sleep(100); } } - + @SneakyThrows private boolean hasLeadership(final ZookeeperElectionService zookeeperElectionService) { return ((LeaderSelector) getFieldValue(zookeeperElectionService, "leaderSelector")).hasLeadership(); } - + @SneakyThrows private Object getFieldValue(final Object target, final String fieldName) { Field field = target.getClass().getDeclaredField(fieldName); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java index 61626ceecb..d4f4fe7167 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -58,9 +58,9 @@ public static void tearDown() { @Test public void assertInitWithDigestSuccess() throws Exception { CuratorFramework client = CuratorFrameworkFactory.builder() - .connectString(EmbedTestingServer.getConnectionString()) - .retryPolicy(new RetryOneTime(2000)) - .authorization("digest", "digest:password".getBytes()).build(); + .connectString(EmbedTestingServer.getConnectionString()) + .retryPolicy(new RetryOneTime(2000)) + .authorization("digest", "digest:password".getBytes()).build(); client.start(); client.blockUntilConnected(); assertThat(client.getData().forPath("/" + ZookeeperRegistryCenterForAuthTest.class.getName() + "/test/deep/nested"), is("deepNested".getBytes())); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java index 9d301af581..dc59f3ad97 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,7 +23,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; public final class ZookeeperRegistryCenterInitFailureTest { - + @Test public void assertInitFailure() { assertThrows(RegException.class, () -> { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java index bd4f0a65ee..a5e84a63fb 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java @@ -43,41 +43,41 @@ @ExtendWith(MockitoExtension.class) public class ZookeeperRegistryCenterListenerTest { - + @Mock private Map caches; - + @Mock private CuratorFramework client; - + @Mock private CuratorCache cache; - + @Mock private Listenable connStateListenable; - + @Mock private Listenable dataListenable; - + private ZookeeperRegistryCenter regCenter; - + private final String jobPath = "/test_job"; - + @BeforeEach public void setUp() { regCenter = new ZookeeperRegistryCenter(null); ZookeeperRegistryCenterTestUtil.setFieldValue(regCenter, "caches", caches); ZookeeperRegistryCenterTestUtil.setFieldValue(regCenter, "client", client); } - + @Test - public void testAddConnectionStateChangedEventListener() throws Exception { + public void testAddConnectionStateChangedEventListener() { when(client.getConnectionStateListenable()).thenReturn(connStateListenable); regCenter.addConnectionStateChangedEventListener(jobPath, null); verify(client.getConnectionStateListenable()).addListener(any()); assertEquals(1, getConnStateListeners().get(jobPath).size()); } - + @Test public void testWatch() { when(caches.get(jobPath + "/")).thenReturn(cache); @@ -86,7 +86,7 @@ public void testWatch() { verify(cache.listenable()).addListener(any()); assertEquals(1, getDataListeners().get(jobPath).size()); } - + @Test public void testRemoveDataListenersNonCache() { when(cache.listenable()).thenReturn(dataListenable); @@ -94,7 +94,7 @@ public void testRemoveDataListenersNonCache() { verify(cache.listenable(), never()).removeListener(any()); assertNull(getDataListeners().get(jobPath)); } - + @Test public void testRemoveDataListenersHasCache() { when(caches.get(jobPath + "/")).thenReturn(cache); @@ -107,16 +107,16 @@ public void testRemoveDataListenersHasCache() { assertNull(getDataListeners().get(jobPath)); verify(cache.listenable(), times(2)).removeListener(null); } - + @Test - public void testRemoveDataListenersHasCacheEmptyListeners() throws Exception { + public void testRemoveDataListenersHasCacheEmptyListeners() { when(caches.get(jobPath + "/")).thenReturn(cache); when(cache.listenable()).thenReturn(dataListenable); regCenter.removeDataListeners(jobPath); assertNull(getDataListeners().get(jobPath)); verify(cache.listenable(), never()).removeListener(null); } - + @Test public void testRemoveConnStateListener() { when(client.getConnectionStateListenable()).thenReturn(connStateListenable); @@ -129,21 +129,21 @@ public void testRemoveConnStateListener() { assertNull(getConnStateListeners().get(jobPath)); verify(client.getConnectionStateListenable(), times(2)).removeListener(null); } - + @Test - public void testRemoveConnStateListenerEmptyListeners() throws Exception { + public void testRemoveConnStateListenerEmptyListeners() { when(client.getConnectionStateListenable()).thenReturn(connStateListenable); regCenter.removeConnStateListener(jobPath); assertNull(getConnStateListeners().get(jobPath)); verify(client.getConnectionStateListenable(), never()).removeListener(null); } - + @SuppressWarnings("unchecked") private Map> getConnStateListeners() { return (Map>) ZookeeperRegistryCenterTestUtil .getFieldValue(regCenter, "connStateListeners"); } - + @SuppressWarnings("unchecked") private Map> getDataListeners() { return (Map>) ZookeeperRegistryCenterTestUtil diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java index 332ed279a0..119335b6f0 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -30,7 +30,7 @@ public final class ZookeeperRegistryCenterMiscellaneousTest { - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterMiscellaneousTest.class.getName()); private static ZookeeperRegistryCenter zkRegCenter; diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java index 45756679d4..10da179f00 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java index 9940b8228c..3b22d66051 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -29,7 +29,7 @@ public final class ZookeeperRegistryCenterQueryWithCacheTest { - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterQueryWithCacheTest.class.getName()); private static ZookeeperRegistryCenter zkRegCenter; diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java index d8407dd7e5..94e630d291 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -34,7 +34,7 @@ public final class ZookeeperRegistryCenterQueryWithoutCacheTest { - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterQueryWithoutCacheTest.class.getName()); private static ZookeeperRegistryCenter zkRegCenter; diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java index 52aa4f0400..4f5c08a730 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java @@ -33,12 +33,12 @@ import static org.junit.jupiter.api.Assertions.assertFalse; public final class ZookeeperRegistryCenterTransactionTest { - + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterTransactionTest.class.getName()); - + private static ZookeeperRegistryCenter zkRegCenter; - + @BeforeAll public static void setUp() { EmbedTestingServer.start(); @@ -46,12 +46,12 @@ public static void setUp() { ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); } - + @BeforeEach public void setup() { ZookeeperRegistryCenterTestUtil.persist(zkRegCenter); } - + @Test public void assertExecuteInTransactionSucceeded() throws Exception { List operations = new ArrayList<>(3); @@ -62,7 +62,7 @@ public void assertExecuteInTransactionSucceeded() throws Exception { zkRegCenter.executeInTransaction(operations); assertThat(zkRegCenter.getDirectly("/test/transaction"), is("transaction")); } - + @Test public void assertExecuteInTransactionFailed() throws Exception { List operations = new ArrayList<>(3); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java index 1bf5a24edc..f6a0eeaf07 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java @@ -36,11 +36,11 @@ import static org.hamcrest.MatcherAssert.assertThat; public final class ZookeeperRegistryCenterWatchTest { - + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterWatchTest.class.getName()); - + private static ZookeeperRegistryCenter zkRegCenter; - + @BeforeAll public static void setUp() { EmbedTestingServer.start(); @@ -49,12 +49,12 @@ public static void setUp() { zkRegCenter.init(); ZookeeperRegistryCenterTestUtil.persist(zkRegCenter); } - + @AfterAll public static void tearDown() { zkRegCenter.close(); } - + @Test @Timeout(value = 10000L, unit = TimeUnit.MILLISECONDS) public void assertWatchWithoutExecutor() throws InterruptedException { @@ -73,7 +73,7 @@ public void assertWatchWithoutExecutor() throws InterruptedException { zkRegCenter.update(key, "countDown"); waitingForCountDownValue.await(); } - + @Test @Timeout(value = 10000L, unit = TimeUnit.MILLISECONDS) public void assertWatchWithExecutor() throws InterruptedException { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java index fac6876979..70ae28a00b 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -36,11 +36,11 @@ public final class EmbedTestingServer { private static final int PORT = 9181; - + private static volatile TestingServer testingServer; - + private static final Object INIT_LOCK = new Object(); - + /** * Start embed zookeeper server. */ @@ -59,7 +59,7 @@ public static void start() { waitTestingServerReady(); } } - + private static void start0() { try { testingServer = new TestingServer(PORT, true); @@ -81,7 +81,7 @@ private static void start0() { })); } } - + private static void waitTestingServerReady() { int maxRetries = 60; try (CuratorFramework client = buildCuratorClient()) { @@ -107,7 +107,7 @@ private static void waitTestingServerReady() { } } } - + private static CuratorFramework buildCuratorClient() { CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); int retryIntervalMilliseconds = 500; @@ -119,11 +119,11 @@ private static CuratorFramework buildCuratorClient() { builder.connectionTimeoutMs(500); return builder.build(); } - + private static boolean isIgnoredException(final Throwable cause) { return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; } - + /** * Get the connection string. * @@ -133,4 +133,3 @@ public static String getConnectionString() { return "localhost:" + PORT; } } - diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java index 2dfcbb5e38..e9f8da443b 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java @@ -7,7 +7,7 @@ * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -37,7 +37,7 @@ public static void persist(final ZookeeperRegistryCenter zookeeperRegistryCenter zookeeperRegistryCenter.persist("/test/deep/nested", "deepNested"); zookeeperRegistryCenter.persist("/test/child", "child"); } - + /** * Set field value use reflection. * @@ -51,7 +51,7 @@ public static void setFieldValue(final Object target, final String fieldName, fi field.setAccessible(true); field.set(target, fieldValue); } - + /** * Get field value use reflection. * diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml index ea5f73588d..932d59c8d2 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml @@ -17,16 +17,16 @@ --> + 4.0.0 - elasticjob-registry-center org.apache.shardingsphere.elasticjob + elasticjob-registry-center 3.1.0-SNAPSHOT - 4.0.0 elasticjob-regitry-center-provider - ${project.artifactId} pom - + ${project.artifactId} + elasticjob-registry-center-zookeeper-curator diff --git a/elasticjob-infra/elasticjob-registry-center/pom.xml b/elasticjob-infra/elasticjob-registry-center/pom.xml index 11272ee7a3..953f4f0c7b 100644 --- a/elasticjob-infra/elasticjob-registry-center/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/pom.xml @@ -24,12 +24,12 @@ 3.1.0-SNAPSHOT elasticjob-registry-center - ${project.artifactId} pom - + ${project.artifactId} + elasticjob-registry-center-api elasticjob-regitry-center-provider - + diff --git a/elasticjob-infra/elasticjob-restful/pom.xml b/elasticjob-infra/elasticjob-restful/pom.xml index 61705269dd..d1a49c7101 100644 --- a/elasticjob-infra/elasticjob-restful/pom.xml +++ b/elasticjob-infra/elasticjob-restful/pom.xml @@ -17,16 +17,16 @@ --> + 4.0.0 - elasticjob-infra org.apache.shardingsphere.elasticjob + elasticjob-infra 3.1.0-SNAPSHOT - 4.0.0 - + elasticjob-restful ${project.artifactId} - + org.apache.shardingsphere.elasticjob diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java b/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java index 63b3b56575..5b5df09b7f 100644 --- a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java +++ b/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java @@ -37,6 +37,7 @@ public final class RequestBodyDeserializerFactory { private static final Map DEFAULT_REQUEST_BODY_DESERIALIZER_FACTORIES = new ConcurrentHashMap<>(); private static final RequestBodyDeserializer MISSING_DESERIALIZER = new RequestBodyDeserializer() { + @Override public String mimeType() { throw new UnsupportedOperationException(); diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java b/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java index d0459dbe85..a0a93aa1a9 100644 --- a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java +++ b/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java @@ -29,15 +29,13 @@ import org.apache.shardingsphere.elasticjob.restful.handler.HandleContext; import org.apache.shardingsphere.elasticjob.restful.handler.Handler; - /** * Create an instance of {@link FullHttpResponse} and initialize {@link HandleContext}. */ -@Slf4j @Sharable +@Slf4j public final class ContextInitializationInboundHandler extends ChannelInboundHandlerAdapter { - @SuppressWarnings("NullableProblems") @Override public void channelRead(final ChannelHandlerContext ctx, final Object msg) { log.debug("{}", msg); diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java b/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java index 1387480195..33e221912c 100644 --- a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java +++ b/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java @@ -37,6 +37,7 @@ public final class ResponseBodySerializerFactory { private static final Map RESPONSE_BODY_SERIALIZER_FACTORIES = new ConcurrentHashMap<>(); private static final ResponseBodySerializer MISSING_SERIALIZER = new ResponseBodySerializer() { + @Override public String mimeType() { throw new UnsupportedOperationException(); diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java index 9c79763559..0376b03458 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java @@ -33,7 +33,6 @@ public void assertGetJsonDefaultDeserializer() { @Test public void assertDeserializerNotFound() { - assertThrows(RequestBodyDeserializerNotFoundException.class, () -> - RequestBodyDeserializerFactory.getRequestBodyDeserializer("Unknown")); + assertThrows(RequestBodyDeserializerNotFoundException.class, () -> RequestBodyDeserializerFactory.getRequestBodyDeserializer("Unknown")); } } diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java index 94b56c67f8..7af51ce1ad 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java @@ -93,16 +93,15 @@ public static class DecoderTestController implements RestfulController { */ @Mapping(method = Http.GET, path = "/{appName}/{ch}") public String handle( - final @Param(source = ParamSource.PATH, name = "appName") String appName, - final @Param(source = ParamSource.PATH, name = "ch") char ch, - final @Param(source = ParamSource.QUERY, name = "cron") String cron, - final @Param(source = ParamSource.HEADER, name = "Message") String message, - final @RequestBody String body, - final @Param(source = ParamSource.QUERY, name = "integer") int integer, - final @Param(source = ParamSource.QUERY, name = "bool") Boolean bool, - final @Param(source = ParamSource.QUERY, name = "long") Long longValue, - final @Param(source = ParamSource.QUERY, name = "double") double doubleValue - ) { + final @Param(source = ParamSource.PATH, name = "appName") String appName, + final @Param(source = ParamSource.PATH, name = "ch") char ch, + final @Param(source = ParamSource.QUERY, name = "cron") String cron, + final @Param(source = ParamSource.HEADER, name = "Message") String message, + final @RequestBody String body, + final @Param(source = ParamSource.QUERY, name = "integer") int integer, + final @Param(source = ParamSource.QUERY, name = "bool") Boolean bool, + final @Param(source = ParamSource.QUERY, name = "long") Long longValue, + final @Param(source = ParamSource.QUERY, name = "double") double doubleValue) { assertThat(appName, is("myApp")); assertThat(ch, is('C')); assertThat(cron, is("0 * * * * ?")); diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java index 7c5bfa0b75..2c2296d138 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java @@ -58,14 +58,16 @@ public static void request(final String host, final int port, final FullHttpRequ .channel(NioSocketChannel.class) .remoteAddress(host, port) .handler(new ChannelInitializer() { + @Override protected void initChannel(final Channel ch) { ch.pipeline() .addLast(new HttpClientCodec()) .addLast(new HttpObjectAggregator(1024 * 1024)) .addLast(new SimpleChannelInboundHandler() { + @Override - protected void channelRead0(final ChannelHandlerContext ctx, final FullHttpResponse httpResponse) throws Exception { + protected void channelRead0(final ChannelHandlerContext ctx, final FullHttpResponse httpResponse) { try { consumer.accept(httpResponse); } finally { diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java index 860637ef04..b32934535b 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java @@ -33,7 +33,6 @@ public void assertGetJsonDefaultSerializer() { @Test public void assertSerializerNotFound() { - assertThrows(ResponseBodySerializerNotFoundException.class, () -> - ResponseBodySerializerFactory.getResponseBodySerializer("Unknown")); + assertThrows(ResponseBodySerializerNotFoundException.class, () -> ResponseBodySerializerFactory.getResponseBodySerializer("Unknown")); } } diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-lite/elasticjob-lite-core/pom.xml index 8de1f04b5f..dc30809ede 100644 --- a/elasticjob-lite/elasticjob-lite-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-core/pom.xml @@ -1,3 +1,4 @@ + 3.2.1 3.1.1 @@ -102,6 +102,7 @@ 0.15 + 2.22.1 3.1.0 3.0.2 3.20.0 @@ -285,7 +286,7 @@ ${lombok.version} provided - + com.h2database h2 @@ -359,7 +360,7 @@ - + org.junit.jupiter @@ -395,13 +396,13 @@ org.apache.maven.plugins maven-compiler-plugin + ${maven-compiler-plugin.version} ${java.version} ${java.version} ${java.version} ${java.version} - ${maven-compiler-plugin.version} org.apache.maven.plugins @@ -496,14 +497,6 @@ net.nicoulaj.maven.plugins checksum-maven-plugin ${checksum-maven-plugin.version} - - - package - - artifacts - - - true @@ -518,6 +511,14 @@ + + + + artifacts + + package + + @@ -528,16 +529,23 @@ attach-sources - verify jar-no-fork + verify org.apache.maven.plugins maven-javadoc-plugin + + true + ${java.version} + ${project.build.sourceEncoding} + ${project.build.sourceEncoding} + ${project.build.sourceEncoding} + attach-javadocs @@ -546,13 +554,6 @@ - - true - ${java.version} - ${project.build.sourceEncoding} - ${project.build.sourceEncoding} - ${project.build.sourceEncoding} - org.apache.maven.plugins @@ -578,21 +579,61 @@ + + com.diffplug.spotless + spotless-maven-plugin + ${spotless-maven-plugin.version} + + + + + ${maven.multiModuleProjectDirectory}/src/resources/spotless/java.xml + + + + ${maven.multiModuleProjectDirectory}/src/resources/spotless/copyright.txt + + + + + UTF-8 + 4 + true + true + false + true + false + false + custom_1 + false + false + + + Leading blank line + --> +<project + --> + +<project + + + + org.apache.maven.plugins maven-checkstyle-plugin ${maven-checkstyle-plugin.version} - src/main/resources/checkstyle_ci.xml + src/resources/checkstyle_ci.xml true validate - validate check + validate @@ -643,10 +684,10 @@ report - test report + test @@ -710,37 +751,16 @@ - verify check + verify - - - jdk11+ - - [11,) - - - - - - maven-surefire-plugin - - @{argLine} --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED - - - - - - - - @@ -758,10 +778,10 @@ aggregate - false aggregate + false @@ -779,7 +799,7 @@ maven-checkstyle-plugin ${maven-checkstyle-plugin.version} - src/main/resources/checkstyle.xml + src/resources/checkstyle.xml true @@ -819,20 +839,41 @@ - - scm:git:https://github.com/apache/shardingsphere-elasticjob.git - scm:git:https://github.com/apache/shardingsphere-elasticjob.git - https://github.com/apache/shardingsphere-elasticjob.git - HEAD - - ShardingSphere Developer List - dev@shardingsphere.apache.org dev-subscribe@shardingsphere.apache.org dev-unsubscribe@shardingsphere.apache.org + dev@shardingsphere.apache.org - + + + scm:git:https://github.com/apache/shardingsphere-elasticjob.git + scm:git:https://github.com/apache/shardingsphere-elasticjob.git + https://github.com/apache/shardingsphere-elasticjob.git + HEAD + + + + + jdk11+ + + [11,) + + + + + + maven-surefire-plugin + + @{argLine} --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED + + + + + + + + diff --git a/src/main/resources/checkstyle.xml b/src/resources/checkstyle.xml similarity index 100% rename from src/main/resources/checkstyle.xml rename to src/resources/checkstyle.xml diff --git a/src/main/resources/checkstyle_ci.xml b/src/resources/checkstyle_ci.xml similarity index 100% rename from src/main/resources/checkstyle_ci.xml rename to src/resources/checkstyle_ci.xml diff --git a/src/resources/spotless/copyright.txt b/src/resources/spotless/copyright.txt new file mode 100644 index 0000000000..6a9c064171 --- /dev/null +++ b/src/resources/spotless/copyright.txt @@ -0,0 +1,17 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + diff --git a/src/resources/spotless/java.xml b/src/resources/spotless/java.xml new file mode 100644 index 0000000000..b552ef9e08 --- /dev/null +++ b/src/resources/spotless/java.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +