This is an automated email from the ASF dual-hosted git repository.
wuweijie 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 86590d7 Remove ClusterPersistRepositoryFactory (#12026)
86590d7 is described below
commit 86590d7195a2e875f432b781c4e26b6d26392103
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Aug 26 17:41:35 2021 +0800
Remove ClusterPersistRepositoryFactory (#12026)
---
.../registry/ClusterPersistRepositoryFactory.java | 50 ----------------------
.../ClusterPersistRepositoryFactoryTest.java | 35 ---------------
.../spring/standalone-application-context.xml | 2 +-
3 files changed, 1 insertion(+), 86 deletions(-)
diff --git
a/shardingsphere-governance/src/main/java/org/apache/shardingsphere/governance/core/registry/ClusterPersistRepositoryFactory.java
b/shardingsphere-governance/src/main/java/org/apache/shardingsphere/governance/core/registry/ClusterPersistRepositoryFactory.java
deleted file mode 100644
index c1cc387..0000000
---
a/shardingsphere-governance/src/main/java/org/apache/shardingsphere/governance/core/registry/ClusterPersistRepositoryFactory.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.shardingsphere.governance.core.registry;
-
-import com.google.common.base.Preconditions;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepositoryConfiguration;
-import
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
-import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
-import org.apache.shardingsphere.infra.spi.typed.TypedSPIRegistry;
-
-/**
- * Cluster persist repository factory.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ClusterPersistRepositoryFactory {
-
- static {
- ShardingSphereServiceLoader.register(ClusterPersistRepository.class);
- }
-
- /**
- * Create new instance of cluster persist repository.
- *
- * @param config cluster persist repository configuration
- * @return new instance of cluster persist repository
- */
- public static ClusterPersistRepository newInstance(final
ClusterPersistRepositoryConfiguration config) {
- Preconditions.checkNotNull(config, "Cluster persist repository
configuration cannot be null.");
- ClusterPersistRepository result =
TypedSPIRegistry.getRegisteredService(ClusterPersistRepository.class,
config.getType(), config.getProps());
- result.init(config);
- return result;
- }
-}
diff --git
a/shardingsphere-governance/src/test/java/org/apache/shardingsphere/governance/core/registry/ClusterPersistRepositoryFactoryTest.java
b/shardingsphere-governance/src/test/java/org/apache/shardingsphere/governance/core/registry/ClusterPersistRepositoryFactoryTest.java
deleted file mode 100644
index 7fcfb50..0000000
---
a/shardingsphere-governance/src/test/java/org/apache/shardingsphere/governance/core/registry/ClusterPersistRepositoryFactoryTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.shardingsphere.governance.core.registry;
-
-import
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepositoryConfiguration;
-import org.junit.Test;
-
-import java.util.Properties;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public final class ClusterPersistRepositoryFactoryTest {
-
- @Test
- public void assertNewInstance() {
- ClusterPersistRepositoryConfiguration config = new
ClusterPersistRepositoryConfiguration("TEST", "test_name", "127.0.0.1", new
Properties());
-
assertThat(ClusterPersistRepositoryFactory.newInstance(config).getType(),
is("TEST"));
- }
-}
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/spring/standalone-application-context.xml
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/spring/standalone-application-context.xml
index 5f561a9..f383c11 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/spring/standalone-application-context.xml
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/spring/standalone-application-context.xml
@@ -31,7 +31,7 @@
http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/standalone/repository.xsd
">
<context:property-placeholder location="classpath:conf/conf.properties" />
-
+
<import resource="included/data-sources-context.xml" />
<import resource="included/rules-context.xml" />