Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spotless #2276

Merged
merged 3 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@
* @return timeZone
*/
String timeZone() default "";



/**
* registry center name.
* @return registryCenter
*/
String registryCenter() default "";

/**
* Sharding total count.
* @return shardingTotalCount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -122,9 +122,9 @@ public static class Builder {
private String jobExecutorServiceHandlerType;

private String jobErrorHandlerType;

private final Collection<String> jobListenerTypes = new ArrayList<>();

private final Collection<JobExtraConfiguration> extraConfigurations = new LinkedList<>();

private String description = "";
Expand All @@ -134,11 +134,11 @@ public static class Builder {
private boolean disabled;

private boolean overwrite;

private String label;

private boolean staticSharding;

/**
* Cron expression.
*
Expand All @@ -151,7 +151,7 @@ public Builder cron(final String cron) {
}
return this;
}

/**
* time zone.
*
Expand All @@ -171,7 +171,6 @@ public Builder timeZone(final String timeZone) {
* <p>
* 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
* </p>
Expand Down Expand Up @@ -206,7 +205,6 @@ public Builder jobParameter(final String jobParameter) {
* <p>
* 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.
* </p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<? extends JobExtraConfigurationFactory> factory :annotation.extraConfigurations()) {
for (Class<? extends JobExtraConfigurationFactory> factory : annotation.extraConfigurations()) {
assertThat(factory, is(SimpleTracingConfigurationFactory.class));
}
assertArrayEquals(annotation.jobListenerTypes(), new String[] {"NOOP", "LOG"});
assertArrayEquals(annotation.jobListenerTypes(), new String[]{"NOOP", "LOG"});
Queue<String> propsKey = new LinkedList<>(Arrays.asList("print.title", "print.content"));
Queue<String> 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()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public enum StatisticInterval {

MINUTE("0 * * * * ?"),

HOUR("0 0 * * * ?"),
HOUR("0 0 * * * ?"),

DAY("0 0 0 * * ?");

Expand Down
Loading
Loading