You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/04/10 03:02:22 UTC
[shardingsphere] branch master updated: Optimize code for checkStyle (#15876) (#16710)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 3030ea5fa7e Optimize code for checkStyle (#15876) (#16710)
3030ea5fa7e is described below
commit 3030ea5fa7ef53f97e84bf0b2939dfb96f050dbc
Author: galaxy <ga...@tencent.com>
AuthorDate: Sun Apr 10 11:02:16 2022 +0800
Optimize code for checkStyle (#15876) (#16710)
---
.../apache/shardingsphere/infra/datasource/registry/Instance.java | 4 +---
.../impl/ShardingSpherePipelineDataSourceConfigurationTest.java | 8 ++++----
.../src/main/resources/conf/server.yaml | 2 +-
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/datasource/registry/Instance.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/datasource/registry/Instance.java
index 33bd0f0e417..f55e9de0cb8 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/datasource/registry/Instance.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/datasource/registry/Instance.java
@@ -21,9 +21,8 @@ import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-
/**
- * instance.
+ * Instance.
*/
@RequiredArgsConstructor
@Getter
@@ -33,6 +32,5 @@ public final class Instance {
private final String ip;
private final Integer port;
-
}
diff --git a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-spi/src/test/java/org/apache/shardingsphere/data/pipeline/api/datasource/config/impl/ShardingSpherePipelineDataSourceConfigurationTest.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-spi/src/test/java/org/apache/shardingsphere/data/pipeline/api/datasource/config/impl/ShardingSpherePipelineDataSourceConfigurationTest.java
index 54548657833..26684b0dfb4 100644
--- a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-spi/src/test/java/org/apache/shardingsphere/data/pipeline/api/datasource/config/impl/ShardingSpherePipelineDataSourceConfigurationTest.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-spi/src/test/java/org/apache/shardingsphere/data/pipeline/api/datasource/config/impl/ShardingSpherePipelineDataSourceConfigurationTest.java
@@ -22,11 +22,11 @@ import org.apache.shardingsphere.infra.datasource.props.InvalidDataSourcePropert
import org.apache.shardingsphere.infra.yaml.config.swapper.YamlDataSourceConfigurationSwapper;
import org.junit.Test;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
+import java.util.LinkedHashMap;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
@@ -40,7 +40,7 @@ public final class ShardingSpherePipelineDataSourceConfigurationTest {
Properties queryProps = new Properties();
queryProps.setProperty("rewriteBatchedStatements", Boolean.TRUE.toString());
dataSourceConfig.appendJDBCQueryProperties(queryProps);
- List<DataSourceProperties> actual = new ArrayList<>(getDataSourcePropertiesMap(dataSourceConfig.getRootConfig().getDataSources()).values());
+ List<DataSourceProperties> actual = new LinkedList<>(getDataSourcePropertiesMap(dataSourceConfig.getRootConfig().getDataSources()).values());
assertThat(actual.get(0).getAllLocalProperties().get("jdbcUrl"), is("jdbc:mysql://192.168.0.2:3306/scaling?serverTimezone=UTC&useSSL=false&rewriteBatchedStatements=true"));
assertThat(actual.get(1).getAllLocalProperties().get("jdbcUrl"), is("jdbc:mysql://192.168.0.1:3306/scaling?serverTimezone=UTC&useSSL=false&rewriteBatchedStatements=true"));
}
@@ -64,7 +64,7 @@ public final class ShardingSpherePipelineDataSourceConfigurationTest {
@Test
public void assertDataSourceCanBeAggregation() throws InvalidDataSourcePropertiesException {
ShardingSpherePipelineDataSourceConfiguration dataSourceConfig = new ShardingSpherePipelineDataSourceConfiguration(getDataSourceAggregationYaml());
- List<DataSourceProperties> actual = new ArrayList<>(getDataSourcePropertiesMap(dataSourceConfig.getRootConfig().getDataSources()).values());
+ List<DataSourceProperties> actual = new LinkedList<>(getDataSourcePropertiesMap(dataSourceConfig.getRootConfig().getDataSources()).values());
assertTrue(actual.get(0).isInSameDatabaseInstance(actual.get(0).getAllLocalProperties().get("jdbcUrl").toString(), actual.get(1).getAllLocalProperties().get("jdbcUrl").toString()));
actual.get(0).checkToBeAggregatedDataSources(actual.get(1));
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/server.yaml b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/server.yaml
index 9a289794b1f..a5b736ff448 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/server.yaml
+++ b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/server.yaml
@@ -81,4 +81,4 @@
# sql-federation-enabled: false
# # Available proxy backend driver type: JDBC (default), ExperimentalVertx
# proxy-backend-driver-type: JDBC
-# data-source-aggregation-enabled: false
\ No newline at end of file
+# data-source-aggregation-enabled: false