This is an automated email from the ASF dual-hosted git repository.

zhaojinchao 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 539993cbe18 Merge TypedSPI and RequiredSPI (#23738)
539993cbe18 is described below

commit 539993cbe18a69b26edf7af400ab487ca3b0c707
Author: Liang Zhang <[email protected]>
AuthorDate: Fri Jan 27 13:07:38 2023 +0800

    Merge TypedSPI and RequiredSPI (#23738)
    
    * Rename DefaultSPILoader
    
    * Merge TypedSPI and RequiredSPI
    
    * Merge TypedSPI and RequiredSPI
---
 .../spi/ReadQueryLoadBalanceAlgorithm.java         |  3 +-
 .../sharding/spi/KeyGenerateAlgorithm.java         |  3 +-
 .../detector/DataSourcePoolActiveDetector.java     |  3 +-
 .../loader/datatype/DialectDataTypeLoader.java     |  3 +-
 .../loader/DialectQueryResultDataRowLoader.java    |  3 +-
 .../infra/util/spi/type/required/RequiredSPI.java  | 33 -----------
 .../spi/type/required/RequiredSPIRegistry.java     | 65 ----------------------
 .../infra/util/spi/type/typed/TypedSPI.java        |  9 +++
 .../util/spi/type/typed/TypedSPIRegistry.java      | 24 +++++---
 .../spi/type/required/RequiredSPIRegistryTest.java | 59 --------------------
 .../fixture/empty/EmptyRequiredSPIFixture.java     | 23 --------
 .../MultipleWithDefaultRequiredSPIFixture.java     | 23 --------
 .../MultipleWithoutDefaultRequiredSPIFixture.java  | 23 --------
 ...arNotDefaultMultipleRequiredSPIFixtureImpl.java | 24 --------
 .../DefaultMultipleRequiredSPIFixtureImpl.java     | 28 ----------
 ...ooNotDefaultMultipleRequiredSPIFixtureImpl.java | 24 --------
 .../fixture/single/SingleRequiredSPIFixture.java   | 24 --------
 .../single/impl/SingleRequiredSPIFixtureImpl.java  | 34 -----------
 ....multiple.MultipleWithDefaultRequiredSPIFixture | 19 -------
 ...ltiple.MultipleWithoutDefaultRequiredSPIFixture | 19 -------
 ...equired.fixture.single.SingleRequiredSPIFixture | 18 ------
 .../spi/ingest/dumper/ColumnValueReader.java       |  3 +-
 .../spi/ingest/position/PositionInitializer.java   |  3 +-
 .../spi/sharding/ShardingColumnsExtractor.java     |  3 +-
 .../spi/sqlbuilder/PipelineSQLBuilder.java         |  3 +-
 .../sqlfederation/spi/SQLFederationExecutor.java   |  3 +-
 .../parser/dialect/OptimizerSQLDialectBuilder.java |  3 +-
 .../sqltranslator/spi/SQLTranslator.java           |  3 +-
 .../timeservice/spi/ShardingSphereTimeService.java |  3 +-
 .../traffic/spi/TrafficLoadBalanceAlgorithm.java   |  3 +-
 .../swapper/DataSourcePropertyProvider.java        |  3 +-
 .../xa/spi/XATransactionManagerProvider.java       |  3 +-
 .../mode/manager/ContextManagerBuilder.java        |  3 +-
 .../StandaloneContextManagerBuilderTest.java       |  3 +-
 .../standalone/StandalonePersistRepository.java    |  5 +-
 .../repository/standalone/jdbc/JDBCRepository.java |  5 ++
 .../jdbc/provider/JDBCRepositoryProvider.java      |  3 +-
 .../response/header/query/QueryHeaderBuilder.java  |  3 +-
 38 files changed, 52 insertions(+), 467 deletions(-)

diff --git 
a/features/readwrite-splitting/api/src/main/java/org/apache/shardingsphere/readwritesplitting/spi/ReadQueryLoadBalanceAlgorithm.java
 
b/features/readwrite-splitting/api/src/main/java/org/apache/shardingsphere/readwritesplitting/spi/ReadQueryLoadBalanceAlgorithm.java
index 962462b891c..666e730ef4e 100644
--- 
a/features/readwrite-splitting/api/src/main/java/org/apache/shardingsphere/readwritesplitting/spi/ReadQueryLoadBalanceAlgorithm.java
+++ 
b/features/readwrite-splitting/api/src/main/java/org/apache/shardingsphere/readwritesplitting/spi/ReadQueryLoadBalanceAlgorithm.java
@@ -19,14 +19,13 @@ package org.apache.shardingsphere.readwritesplitting.spi;
 
 import org.apache.shardingsphere.infra.algorithm.ShardingSphereAlgorithm;
 import 
org.apache.shardingsphere.infra.context.transaction.TransactionConnectionContext;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 
 import java.util.List;
 
 /**
  * Read query load-balance algorithm.
  */
-public interface ReadQueryLoadBalanceAlgorithm extends 
ShardingSphereAlgorithm, RequiredSPI {
+public interface ReadQueryLoadBalanceAlgorithm extends ShardingSphereAlgorithm 
{
     
     /**
      * Get data source.
diff --git 
a/features/sharding/api/src/main/java/org/apache/shardingsphere/sharding/spi/KeyGenerateAlgorithm.java
 
b/features/sharding/api/src/main/java/org/apache/shardingsphere/sharding/spi/KeyGenerateAlgorithm.java
index 91bab11c48c..8b147fa5c35 100644
--- 
a/features/sharding/api/src/main/java/org/apache/shardingsphere/sharding/spi/KeyGenerateAlgorithm.java
+++ 
b/features/sharding/api/src/main/java/org/apache/shardingsphere/sharding/spi/KeyGenerateAlgorithm.java
@@ -18,12 +18,11 @@
 package org.apache.shardingsphere.sharding.spi;
 
 import org.apache.shardingsphere.infra.algorithm.ShardingSphereAlgorithm;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 
 /**
  * Key generate algorithm.
  */
-public interface KeyGenerateAlgorithm extends ShardingSphereAlgorithm, 
RequiredSPI {
+public interface KeyGenerateAlgorithm extends ShardingSphereAlgorithm {
     
     /**
      * Generate key.
diff --git 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/destroyer/detector/DataSourcePoolActiveDetector.java
 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/destroyer/detector/DataSourcePoolActiveDetector.java
index 373a5402bb3..2ec8fabcbf0 100644
--- 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/destroyer/detector/DataSourcePoolActiveDetector.java
+++ 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/destroyer/detector/DataSourcePoolActiveDetector.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.infra.datasource.pool.destroyer.detector;
 
 import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
 import javax.sql.DataSource;
@@ -27,7 +26,7 @@ import javax.sql.DataSource;
  * Data source pool active detector.
  */
 @SingletonSPI
-public interface DataSourcePoolActiveDetector extends TypedSPI, RequiredSPI {
+public interface DataSourcePoolActiveDetector extends TypedSPI {
     
     /**
      * Whether contains active connection.
diff --git 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/datatype/DialectDataTypeLoader.java
 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/datatype/DialectDataTypeLoader.java
index 99b8e515b08..8cee6a38786 100644
--- 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/datatype/DialectDataTypeLoader.java
+++ 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/datatype/DialectDataTypeLoader.java
@@ -18,7 +18,6 @@
 package 
org.apache.shardingsphere.infra.metadata.database.schema.loader.datatype;
 
 import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
 import java.sql.SQLException;
@@ -28,7 +27,7 @@ import java.util.Map;
  * Dialect data type loader.
  */
 @SingletonSPI
-public interface DialectDataTypeLoader extends TypedSPI, RequiredSPI {
+public interface DialectDataTypeLoader extends TypedSPI {
     
     /**
      * Load data type.
diff --git 
a/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/impl/driver/jdbc/type/memory/loader/DialectQueryResultDataRowLoader.java
 
b/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/impl/driver/jdbc/type/memory/loader/DialectQueryResultDataRowLoader.java
index 1387ee3ec60..171eb6215e7 100644
--- 
a/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/impl/driver/jdbc/type/memory/loader/DialectQueryResultDataRowLoader.java
+++ 
b/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/impl/driver/jdbc/type/memory/loader/DialectQueryResultDataRowLoader.java
@@ -19,7 +19,6 @@ package 
org.apache.shardingsphere.infra.executor.sql.execute.result.query.impl.d
 
 import 
org.apache.shardingsphere.infra.executor.sql.execute.result.query.type.memory.row.MemoryQueryResultDataRow;
 import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
 import java.sql.ResultSet;
@@ -30,7 +29,7 @@ import java.util.Collection;
  * Dialect query result data row loader.
  */
 @SingletonSPI
-public interface DialectQueryResultDataRowLoader extends TypedSPI, RequiredSPI 
{
+public interface DialectQueryResultDataRowLoader extends TypedSPI {
     
     /**
      * Load rows.
diff --git 
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPI.java
 
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPI.java
deleted file mode 100644
index d261b207077..00000000000
--- 
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPI.java
+++ /dev/null
@@ -1,33 +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.infra.util.spi.type.required;
-
-/**
- * Required SPI.
- */
-public interface RequiredSPI {
-    
-    /**
-     * Judge whether default service provider.
-     *
-     * @return is default service provider or not
-     */
-    default boolean isDefault() {
-        return false;
-    }
-}
diff --git 
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPIRegistry.java
 
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPIRegistry.java
deleted file mode 100644
index 9de98973e1d..00000000000
--- 
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPIRegistry.java
+++ /dev/null
@@ -1,65 +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.infra.util.spi.type.required;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader;
-import 
org.apache.shardingsphere.infra.util.spi.exception.ServiceProviderNotFoundServerException;
-import org.apache.shardingsphere.infra.util.spi.lifecycle.SPIPostProcessor;
-
-import java.util.Collection;
-import java.util.Properties;
-
-/**
- * Required SPI registry.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class RequiredSPIRegistry {
-    
-    /**
-     * Get service.
-     *
-     * @param spiClass required SPI class
-     * @param <T> SPI class type
-     * @return service
-     */
-    public static <T extends RequiredSPI> T getService(final Class<T> 
spiClass) {
-        T result = getRequiredService(spiClass);
-        if (result instanceof SPIPostProcessor) {
-            ((SPIPostProcessor) result).init(new Properties());
-        }
-        return result;
-    }
-    
-    private static <T extends RequiredSPI> T getRequiredService(final Class<T> 
spiClass) {
-        Collection<T> services = 
ShardingSphereServiceLoader.getServiceInstances(spiClass);
-        if (services.isEmpty()) {
-            throw new ServiceProviderNotFoundServerException(spiClass);
-        }
-        if (1 == services.size()) {
-            return services.iterator().next();
-        }
-        for (T each : services) {
-            if (each.isDefault()) {
-                return each;
-            }
-        }
-        return services.iterator().next();
-    }
-}
diff --git 
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPI.java
 
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPI.java
index 1c58ad2826e..3180bf1de2d 100644
--- 
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPI.java
+++ 
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPI.java
@@ -42,4 +42,13 @@ public interface TypedSPI {
     default Collection<String> getTypeAliases() {
         return Collections.emptyList();
     }
+    
+    /**
+     * Judge whether default service provider.
+     *
+     * @return is default service provider or not
+     */
+    default boolean isDefault() {
+        return false;
+    }
 }
diff --git 
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPIRegistry.java
 
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPIRegistry.java
index ddf3bf82fd5..f92a7bf716a 100644
--- 
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPIRegistry.java
+++ 
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPIRegistry.java
@@ -22,8 +22,6 @@ import lombok.NoArgsConstructor;
 import org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader;
 import 
org.apache.shardingsphere.infra.util.spi.exception.ServiceProviderNotFoundServerException;
 import org.apache.shardingsphere.infra.util.spi.lifecycle.SPIPostProcessor;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
-import 
org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPIRegistry;
 
 import java.util.Optional;
 import java.util.Properties;
@@ -60,7 +58,7 @@ public final class TypedSPIRegistry {
                 return Optional.of(each);
             }
         }
-        return getRequiredSPI(spiClass);
+        return getService(spiClass);
     }
     
     /**
@@ -82,7 +80,7 @@ public final class TypedSPIRegistry {
                 return Optional.of(each);
             }
         }
-        return getRequiredSPI(spiClass);
+        return getService(spiClass);
     }
     
     private static boolean matchesType(final String type, final TypedSPI 
instance) {
@@ -107,7 +105,7 @@ public final class TypedSPIRegistry {
      * @return service
      */
     public static <T extends TypedSPI> T getService(final Class<T> spiClass, 
final String type) {
-        return findService(spiClass, type).orElseGet(() -> 
getRequiredSPI(spiClass).orElseThrow(() -> new 
ServiceProviderNotFoundServerException(spiClass, type)));
+        return findService(spiClass, type).orElseGet(() -> 
getService(spiClass).orElseThrow(() -> new 
ServiceProviderNotFoundServerException(spiClass)));
     }
     
     /**
@@ -120,11 +118,19 @@ public final class TypedSPIRegistry {
      * @return service
      */
     public static <T extends TypedSPI> T getService(final Class<T> spiClass, 
final String type, final Properties props) {
-        return findService(spiClass, type, props).orElseGet(() -> 
getRequiredSPI(spiClass).orElseThrow(() -> new 
ServiceProviderNotFoundServerException(spiClass, type)));
+        return findService(spiClass, type, props).orElseGet(() -> 
getService(spiClass).orElseThrow(() -> new 
ServiceProviderNotFoundServerException(spiClass)));
     }
     
-    @SuppressWarnings("unchecked")
-    private static <T extends TypedSPI> Optional<T> getRequiredSPI(final 
Class<T> spiClass) {
-        return RequiredSPI.class.isAssignableFrom(spiClass) ? Optional.of((T) 
RequiredSPIRegistry.getService((Class<? extends RequiredSPI>) spiClass)) : 
Optional.empty();
+    private static <T extends TypedSPI> Optional<T> getService(final Class<T> 
spiClass) {
+        for (T each : 
ShardingSphereServiceLoader.getServiceInstances(spiClass)) {
+            if (!each.isDefault()) {
+                continue;
+            }
+            if (each instanceof SPIPostProcessor) {
+                ((SPIPostProcessor) each).init(new Properties());
+            }
+            return Optional.of(each);
+        }
+        return Optional.empty();
     }
 }
diff --git 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPIRegistryTest.java
 
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPIRegistryTest.java
deleted file mode 100644
index 60c63af0906..00000000000
--- 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPIRegistryTest.java
+++ /dev/null
@@ -1,59 +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.infra.util.spi.type.required;
-
-import 
org.apache.shardingsphere.infra.util.spi.exception.ServiceProviderNotFoundServerException;
-import 
org.apache.shardingsphere.infra.util.spi.type.required.fixture.empty.EmptyRequiredSPIFixture;
-import 
org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.MultipleWithDefaultRequiredSPIFixture;
-import 
org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.MultipleWithoutDefaultRequiredSPIFixture;
-import 
org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.impl.BarNotDefaultMultipleRequiredSPIFixtureImpl;
-import 
org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.impl.DefaultMultipleRequiredSPIFixtureImpl;
-import 
org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.impl.FooNotDefaultMultipleRequiredSPIFixtureImpl;
-import 
org.apache.shardingsphere.infra.util.spi.type.required.fixture.single.SingleRequiredSPIFixture;
-import 
org.apache.shardingsphere.infra.util.spi.type.required.fixture.single.impl.SingleRequiredSPIFixtureImpl;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-public final class RequiredSPIRegistryTest {
-    
-    @Test(expected = ServiceProviderNotFoundServerException.class)
-    public void assertRegisteredServiceWithEmptyImplementation() {
-        RequiredSPIRegistry.getService(EmptyRequiredSPIFixture.class);
-    }
-    
-    @Test
-    public void assertRegisteredServiceWithOneImplementation() {
-        SingleRequiredSPIFixture actual = 
RequiredSPIRegistry.getService(SingleRequiredSPIFixture.class);
-        assertThat(actual, instanceOf(SingleRequiredSPIFixtureImpl.class));
-        assertTrue(((SingleRequiredSPIFixtureImpl) actual).isInitialized());
-    }
-    
-    @Test
-    public void 
assertRegisteredServiceWithMoreImplementationsAndWithDefaultImplementation() {
-        
assertThat(RequiredSPIRegistry.getService(MultipleWithDefaultRequiredSPIFixture.class),
 instanceOf(DefaultMultipleRequiredSPIFixtureImpl.class));
-    }
-    
-    @Test
-    public void 
assertRegisteredServiceWithMoreImplementationsAndWithoutDefaultImplementation() 
{
-        MultipleWithoutDefaultRequiredSPIFixture actual = 
RequiredSPIRegistry.getService(MultipleWithoutDefaultRequiredSPIFixture.class);
-        assertTrue(actual instanceof 
FooNotDefaultMultipleRequiredSPIFixtureImpl || actual instanceof 
BarNotDefaultMultipleRequiredSPIFixtureImpl);
-    }
-}
diff --git 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/empty/EmptyRequiredSPIFixture.java
 
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/empty/EmptyRequiredSPIFixture.java
deleted file mode 100644
index 78b66a8bde5..00000000000
--- 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/empty/EmptyRequiredSPIFixture.java
+++ /dev/null
@@ -1,23 +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.infra.util.spi.type.required.fixture.empty;
-
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
-
-public interface EmptyRequiredSPIFixture extends RequiredSPI {
-}
diff --git 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/multiple/MultipleWithDefaultRequiredSPIFixture.java
 
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/multiple/MultipleWithDefaultRequiredSPIFixture.java
deleted file mode 100644
index 85e8a59a566..00000000000
--- 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/multiple/MultipleWithDefaultRequiredSPIFixture.java
+++ /dev/null
@@ -1,23 +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.infra.util.spi.type.required.fixture.multiple;
-
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
-
-public interface MultipleWithDefaultRequiredSPIFixture extends RequiredSPI {
-}
diff --git 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/multiple/MultipleWithoutDefaultRequiredSPIFixture.java
 
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/multiple/MultipleWithoutDefaultRequiredSPIFixture.java
deleted file mode 100644
index 12987260d76..00000000000
--- 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/multiple/MultipleWithoutDefaultRequiredSPIFixture.java
+++ /dev/null
@@ -1,23 +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.infra.util.spi.type.required.fixture.multiple;
-
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
-
-public interface MultipleWithoutDefaultRequiredSPIFixture extends RequiredSPI {
-}
diff --git 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/multiple/impl/BarNotDefaultMultipleRequiredSPIFixtureImpl.java
 
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/multiple/impl/BarNotDefaultMultipleRequiredSPIFixtureImpl.java
deleted file mode 100644
index f012bd493a6..00000000000
--- 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/multiple/impl/BarNotDefaultMultipleRequiredSPIFixtureImpl.java
+++ /dev/null
@@ -1,24 +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.infra.util.spi.type.required.fixture.multiple.impl;
-
-import 
org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.MultipleWithDefaultRequiredSPIFixture;
-import 
org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.MultipleWithoutDefaultRequiredSPIFixture;
-
-public final class BarNotDefaultMultipleRequiredSPIFixtureImpl implements 
MultipleWithDefaultRequiredSPIFixture, MultipleWithoutDefaultRequiredSPIFixture 
{
-}
diff --git 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/multiple/impl/DefaultMultipleRequiredSPIFixtureImpl.java
 
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/multiple/impl/DefaultMultipleRequiredSPIFixtureImpl.java
deleted file mode 100644
index 13ae9bce872..00000000000
--- 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/multiple/impl/DefaultMultipleRequiredSPIFixtureImpl.java
+++ /dev/null
@@ -1,28 +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.infra.util.spi.type.required.fixture.multiple.impl;
-
-import 
org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.MultipleWithDefaultRequiredSPIFixture;
-
-public final class DefaultMultipleRequiredSPIFixtureImpl implements 
MultipleWithDefaultRequiredSPIFixture {
-    
-    @Override
-    public boolean isDefault() {
-        return true;
-    }
-}
diff --git 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/multiple/impl/FooNotDefaultMultipleRequiredSPIFixtureImpl.java
 
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/multiple/impl/FooNotDefaultMultipleRequiredSPIFixtureImpl.java
deleted file mode 100644
index 5142d2917a4..00000000000
--- 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/multiple/impl/FooNotDefaultMultipleRequiredSPIFixtureImpl.java
+++ /dev/null
@@ -1,24 +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.infra.util.spi.type.required.fixture.multiple.impl;
-
-import 
org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.MultipleWithDefaultRequiredSPIFixture;
-import 
org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.MultipleWithoutDefaultRequiredSPIFixture;
-
-public final class FooNotDefaultMultipleRequiredSPIFixtureImpl implements 
MultipleWithDefaultRequiredSPIFixture, MultipleWithoutDefaultRequiredSPIFixture 
{
-}
diff --git 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/single/SingleRequiredSPIFixture.java
 
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/single/SingleRequiredSPIFixture.java
deleted file mode 100644
index b81cfc946bd..00000000000
--- 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/single/SingleRequiredSPIFixture.java
+++ /dev/null
@@ -1,24 +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.infra.util.spi.type.required.fixture.single;
-
-import org.apache.shardingsphere.infra.util.spi.lifecycle.SPIPostProcessor;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
-
-public interface SingleRequiredSPIFixture extends RequiredSPI, 
SPIPostProcessor {
-}
diff --git 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/single/impl/SingleRequiredSPIFixtureImpl.java
 
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/single/impl/SingleRequiredSPIFixtureImpl.java
deleted file mode 100644
index ac81e8ecd1d..00000000000
--- 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/fixture/single/impl/SingleRequiredSPIFixtureImpl.java
+++ /dev/null
@@ -1,34 +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.infra.util.spi.type.required.fixture.single.impl;
-
-import lombok.Getter;
-import 
org.apache.shardingsphere.infra.util.spi.type.required.fixture.single.SingleRequiredSPIFixture;
-
-import java.util.Properties;
-
-@Getter
-public final class SingleRequiredSPIFixtureImpl implements 
SingleRequiredSPIFixture {
-    
-    private boolean initialized;
-    
-    @Override
-    public void init(final Properties props) {
-        initialized = true;
-    }
-}
diff --git 
a/infra/util/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.MultipleWithDefaultRequiredSPIFixture
 
b/infra/util/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.MultipleWithDefaultRequiredSPIFixture
deleted file mode 100644
index b2826f55582..00000000000
--- 
a/infra/util/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.MultipleWithDefaultRequiredSPIFixture
+++ /dev/null
@@ -1,19 +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.
-#
-
-org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.impl.DefaultMultipleRequiredSPIFixtureImpl
-org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.impl.FooNotDefaultMultipleRequiredSPIFixtureImpl
diff --git 
a/infra/util/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.MultipleWithoutDefaultRequiredSPIFixture
 
b/infra/util/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.MultipleWithoutDefaultRequiredSPIFixture
deleted file mode 100644
index 68020541ae3..00000000000
--- 
a/infra/util/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.MultipleWithoutDefaultRequiredSPIFixture
+++ /dev/null
@@ -1,19 +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.
-#
-
-org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.impl.FooNotDefaultMultipleRequiredSPIFixtureImpl
-org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.impl.BarNotDefaultMultipleRequiredSPIFixtureImpl
diff --git 
a/infra/util/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.util.spi.type.required.fixture.single.SingleRequiredSPIFixture
 
b/infra/util/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.util.spi.type.required.fixture.single.SingleRequiredSPIFixture
deleted file mode 100644
index 15a8c3f5871..00000000000
--- 
a/infra/util/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.util.spi.type.required.fixture.single.SingleRequiredSPIFixture
+++ /dev/null
@@ -1,18 +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.
-#
-
-org.apache.shardingsphere.infra.util.spi.type.required.fixture.single.impl.SingleRequiredSPIFixtureImpl
diff --git 
a/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/ingest/dumper/ColumnValueReader.java
 
b/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/ingest/dumper/ColumnValueReader.java
index f7e3d6aa7b3..1c5861cbfad 100644
--- 
a/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/ingest/dumper/ColumnValueReader.java
+++ 
b/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/ingest/dumper/ColumnValueReader.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.data.pipeline.spi.ingest.dumper;
 
 import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
 import java.sql.ResultSet;
@@ -29,7 +28,7 @@ import java.sql.SQLException;
  * Column value reader.
  */
 @SingletonSPI
-public interface ColumnValueReader extends TypedSPI, RequiredSPI {
+public interface ColumnValueReader extends TypedSPI {
     
     /**
      * Read column value.
diff --git 
a/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/ingest/position/PositionInitializer.java
 
b/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/ingest/position/PositionInitializer.java
index 5febb5ecced..9ec5cf0d1c9 100644
--- 
a/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/ingest/position/PositionInitializer.java
+++ 
b/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/ingest/position/PositionInitializer.java
@@ -19,7 +19,6 @@ package 
org.apache.shardingsphere.data.pipeline.spi.ingest.position;
 
 import 
org.apache.shardingsphere.data.pipeline.api.ingest.position.IngestPosition;
 import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
 import javax.sql.DataSource;
@@ -29,7 +28,7 @@ import java.sql.SQLException;
  * Position initializer.
  */
 @SingletonSPI
-public interface PositionInitializer extends TypedSPI, RequiredSPI {
+public interface PositionInitializer extends TypedSPI {
     
     /**
      * Init position by data source.
diff --git 
a/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/sharding/ShardingColumnsExtractor.java
 
b/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/sharding/ShardingColumnsExtractor.java
index 3c9a95d638a..1556c89e0b8 100644
--- 
a/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/sharding/ShardingColumnsExtractor.java
+++ 
b/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/sharding/ShardingColumnsExtractor.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.data.pipeline.spi.sharding;
 
 import org.apache.shardingsphere.data.pipeline.api.metadata.LogicTableName;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 import 
org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlRuleConfiguration;
 
@@ -29,7 +28,7 @@ import java.util.Set;
 /**
  * Sharding columns extractor.
  */
-public interface ShardingColumnsExtractor extends TypedSPI, RequiredSPI {
+public interface ShardingColumnsExtractor extends TypedSPI {
     
     /**
      * Get sharding columns map.
diff --git 
a/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/sqlbuilder/PipelineSQLBuilder.java
 
b/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/sqlbuilder/PipelineSQLBuilder.java
index 71bba785eaf..b05b7c6af1a 100644
--- 
a/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/sqlbuilder/PipelineSQLBuilder.java
+++ 
b/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/sqlbuilder/PipelineSQLBuilder.java
@@ -19,7 +19,6 @@ package 
org.apache.shardingsphere.data.pipeline.spi.sqlbuilder;
 
 import org.apache.shardingsphere.data.pipeline.api.ingest.record.Column;
 import org.apache.shardingsphere.data.pipeline.api.ingest.record.DataRecord;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
 import java.util.Collection;
@@ -29,7 +28,7 @@ import java.util.Optional;
 /**
  * Pipeline SQL builder.
  */
-public interface PipelineSQLBuilder extends TypedSPI, RequiredSPI {
+public interface PipelineSQLBuilder extends TypedSPI {
     
     /**
      * Build create schema SQL.
diff --git 
a/kernel/sql-federation/api/src/main/java/org/apache/shardingsphere/sqlfederation/spi/SQLFederationExecutor.java
 
b/kernel/sql-federation/api/src/main/java/org/apache/shardingsphere/sqlfederation/spi/SQLFederationExecutor.java
index 9442a637f14..271d115f021 100644
--- 
a/kernel/sql-federation/api/src/main/java/org/apache/shardingsphere/sqlfederation/spi/SQLFederationExecutor.java
+++ 
b/kernel/sql-federation/api/src/main/java/org/apache/shardingsphere/sqlfederation/spi/SQLFederationExecutor.java
@@ -25,7 +25,6 @@ import 
org.apache.shardingsphere.infra.executor.sql.prepare.driver.DriverExecuti
 import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
 import org.apache.shardingsphere.infra.metadata.data.ShardingSphereData;
 import org.apache.shardingsphere.infra.util.eventbus.EventBusContext;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
 import java.sql.Connection;
@@ -35,7 +34,7 @@ import java.sql.SQLException;
 /**
  * SQL federation executor.
  */
-public interface SQLFederationExecutor extends TypedSPI, RequiredSPI, 
AutoCloseable {
+public interface SQLFederationExecutor extends TypedSPI, AutoCloseable {
     
     /**
      * Init SQL federation executor.
diff --git 
a/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/OptimizerSQLDialectBuilder.java
 
b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/OptimizerSQLDialectBuilder.java
index b55645ba174..0794cda7c63 100644
--- 
a/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/OptimizerSQLDialectBuilder.java
+++ 
b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/OptimizerSQLDialectBuilder.java
@@ -18,7 +18,6 @@
 package 
org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect;
 
 import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
 import java.util.Properties;
@@ -27,7 +26,7 @@ import java.util.Properties;
  * Optimizer SQL dialect properties builder.
  */
 @SingletonSPI
-public interface OptimizerSQLDialectBuilder extends TypedSPI, RequiredSPI {
+public interface OptimizerSQLDialectBuilder extends TypedSPI {
     
     /**
      * Build optimizer SQL dialect properties.
diff --git 
a/kernel/sql-translator/api/src/main/java/org/apache/shardingsphere/sqltranslator/spi/SQLTranslator.java
 
b/kernel/sql-translator/api/src/main/java/org/apache/shardingsphere/sqltranslator/spi/SQLTranslator.java
index 83e528cf915..62573e09cee 100644
--- 
a/kernel/sql-translator/api/src/main/java/org/apache/shardingsphere/sqltranslator/spi/SQLTranslator.java
+++ 
b/kernel/sql-translator/api/src/main/java/org/apache/shardingsphere/sqltranslator/spi/SQLTranslator.java
@@ -19,7 +19,6 @@ package org.apache.shardingsphere.sqltranslator.spi;
 
 import org.apache.shardingsphere.infra.database.type.DatabaseType;
 import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
 import 
org.apache.shardingsphere.sqltranslator.exception.SQLTranslationException;
@@ -28,7 +27,7 @@ import 
org.apache.shardingsphere.sqltranslator.exception.SQLTranslationException
  * SQL translator.
  */
 @SingletonSPI
-public interface SQLTranslator extends TypedSPI, RequiredSPI {
+public interface SQLTranslator extends TypedSPI {
     
     /**
      * Translate SQL.
diff --git 
a/kernel/time-service/api/src/main/java/org/apache/shardingsphere/timeservice/spi/ShardingSphereTimeService.java
 
b/kernel/time-service/api/src/main/java/org/apache/shardingsphere/timeservice/spi/ShardingSphereTimeService.java
index 538cf4a0264..037c03b7ef5 100644
--- 
a/kernel/time-service/api/src/main/java/org/apache/shardingsphere/timeservice/spi/ShardingSphereTimeService.java
+++ 
b/kernel/time-service/api/src/main/java/org/apache/shardingsphere/timeservice/spi/ShardingSphereTimeService.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.timeservice.spi;
 
 import org.apache.shardingsphere.infra.util.spi.lifecycle.SPIPostProcessor;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
 import java.util.Date;
@@ -26,7 +25,7 @@ import java.util.Date;
 /**
  * ShardingSphere time service.
  */
-public interface ShardingSphereTimeService extends TypedSPI, RequiredSPI, 
SPIPostProcessor {
+public interface ShardingSphereTimeService extends TypedSPI, SPIPostProcessor {
     
     /**
      * Get datetime.
diff --git 
a/kernel/traffic/api/src/main/java/org/apache/shardingsphere/traffic/spi/TrafficLoadBalanceAlgorithm.java
 
b/kernel/traffic/api/src/main/java/org/apache/shardingsphere/traffic/spi/TrafficLoadBalanceAlgorithm.java
index 3acf2344cf4..01e9c4c0965 100644
--- 
a/kernel/traffic/api/src/main/java/org/apache/shardingsphere/traffic/spi/TrafficLoadBalanceAlgorithm.java
+++ 
b/kernel/traffic/api/src/main/java/org/apache/shardingsphere/traffic/spi/TrafficLoadBalanceAlgorithm.java
@@ -19,14 +19,13 @@ package org.apache.shardingsphere.traffic.spi;
 
 import org.apache.shardingsphere.infra.algorithm.ShardingSphereAlgorithm;
 import org.apache.shardingsphere.infra.instance.metadata.InstanceMetaData;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 
 import java.util.List;
 
 /**
  * Traffic load balance algorithm.
  */
-public interface TrafficLoadBalanceAlgorithm extends ShardingSphereAlgorithm, 
RequiredSPI {
+public interface TrafficLoadBalanceAlgorithm extends ShardingSphereAlgorithm {
     
     /**
      * Get instance definition.
diff --git 
a/kernel/transaction/type/xa/core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/datasource/swapper/DataSourcePropertyProvider.java
 
b/kernel/transaction/type/xa/core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/datasource/swapper/DataSourcePropertyProvider.java
index ad86d6f868b..23302d04a7e 100644
--- 
a/kernel/transaction/type/xa/core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/datasource/swapper/DataSourcePropertyProvider.java
+++ 
b/kernel/transaction/type/xa/core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/datasource/swapper/DataSourcePropertyProvider.java
@@ -18,14 +18,13 @@
 package org.apache.shardingsphere.transaction.xa.jta.datasource.swapper;
 
 import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
 /**
  * Data source property provider.
  */
 @SingletonSPI
-public interface DataSourcePropertyProvider extends TypedSPI, RequiredSPI {
+public interface DataSourcePropertyProvider extends TypedSPI {
     
     /**
      * Get URL property name.
diff --git 
a/kernel/transaction/type/xa/spi/src/main/java/org/apache/shardingsphere/transaction/xa/spi/XATransactionManagerProvider.java
 
b/kernel/transaction/type/xa/spi/src/main/java/org/apache/shardingsphere/transaction/xa/spi/XATransactionManagerProvider.java
index 7362dfb6b86..6f6d887cdb5 100644
--- 
a/kernel/transaction/type/xa/spi/src/main/java/org/apache/shardingsphere/transaction/xa/spi/XATransactionManagerProvider.java
+++ 
b/kernel/transaction/type/xa/spi/src/main/java/org/apache/shardingsphere/transaction/xa/spi/XATransactionManagerProvider.java
@@ -17,7 +17,6 @@
 
 package org.apache.shardingsphere.transaction.xa.spi;
 
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
 import javax.sql.XADataSource;
@@ -26,7 +25,7 @@ import javax.transaction.TransactionManager;
 /**
  * XA transaction manager provider.
  */
-public interface XATransactionManagerProvider extends AutoCloseable, TypedSPI, 
RequiredSPI {
+public interface XATransactionManagerProvider extends TypedSPI, AutoCloseable {
     
     /**
      * Initialize XA transaction manager provider.
diff --git 
a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManagerBuilder.java
 
b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManagerBuilder.java
index a58d1bdf190..e689d3fa49d 100644
--- 
a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManagerBuilder.java
+++ 
b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManagerBuilder.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.mode.manager;
 
 import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
 import java.sql.SQLException;
@@ -27,7 +26,7 @@ import java.sql.SQLException;
  * Context manager builder.
  */
 @SingletonSPI
-public interface ContextManagerBuilder extends TypedSPI, RequiredSPI {
+public interface ContextManagerBuilder extends TypedSPI {
     
     /**
      * Build context manager.
diff --git 
a/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilderTest.java
 
b/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilderTest.java
index 2930e28c5e1..61df91c7038 100644
--- 
a/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilderTest.java
+++ 
b/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilderTest.java
@@ -28,6 +28,7 @@ import 
org.apache.shardingsphere.mode.manager.ContextManagerBuilderParameter;
 import 
org.apache.shardingsphere.mode.metadata.persist.node.DatabaseMetaDataNode;
 import org.apache.shardingsphere.mode.metadata.persist.node.GlobalNode;
 import org.apache.shardingsphere.mode.persist.PersistRepository;
+import 
org.apache.shardingsphere.mode.repository.standalone.StandalonePersistRepositoryConfiguration;
 import org.apache.shardingsphere.test.fixture.jdbc.MockedDataSource;
 import org.junit.Test;
 
@@ -54,7 +55,7 @@ public final class StandaloneContextManagerBuilderTest {
     }
     
     private ContextManagerBuilderParameter 
createContextManagerBuilderParameter() {
-        ModeConfiguration modeConfig = new ModeConfiguration("Standalone", 
null);
+        ModeConfiguration modeConfig = new ModeConfiguration("Standalone", new 
StandalonePersistRepositoryConfiguration("FIXTURE", new Properties()));
         Map<String, DatabaseConfiguration> databaseConfigs = 
Collections.singletonMap(
                 "foo_db", new 
DataSourceProvidedDatabaseConfiguration(Collections.singletonMap("foo_ds", new 
MockedDataSource()), Collections.singleton(mock(RuleConfiguration.class))));
         Collection<RuleConfiguration> globalRuleConfigs = 
Collections.singleton(mock(RuleConfiguration.class));
diff --git 
a/mode/type/standalone/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/standalone/StandalonePersistRepository.java
 
b/mode/type/standalone/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/standalone/StandalonePersistRepository.java
index c2bc4fff7ab..5f2779ac881 100644
--- 
a/mode/type/standalone/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/standalone/StandalonePersistRepository.java
+++ 
b/mode/type/standalone/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/standalone/StandalonePersistRepository.java
@@ -17,12 +17,11 @@
 
 package org.apache.shardingsphere.mode.repository.standalone;
 
-import org.apache.shardingsphere.mode.persist.PersistRepository;
 import org.apache.shardingsphere.infra.util.spi.lifecycle.SPIPostProcessor;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
+import org.apache.shardingsphere.mode.persist.PersistRepository;
 
 /**
  * Standalone persist repository.
  */
-public interface StandalonePersistRepository extends PersistRepository, 
RequiredSPI, SPIPostProcessor {
+public interface StandalonePersistRepository extends PersistRepository, 
SPIPostProcessor {
 }
diff --git 
a/mode/type/standalone/repository/provider/jdbc/core/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/JDBCRepository.java
 
b/mode/type/standalone/repository/provider/jdbc/core/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/JDBCRepository.java
index 835b010de8f..32c43f4d9fc 100644
--- 
a/mode/type/standalone/repository/provider/jdbc/core/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/JDBCRepository.java
+++ 
b/mode/type/standalone/repository/provider/jdbc/core/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/JDBCRepository.java
@@ -195,4 +195,9 @@ public final class JDBCRepository implements 
StandalonePersistRepository {
     public String getType() {
         return "JDBC";
     }
+    
+    @Override
+    public boolean isDefault() {
+        return true;
+    }
 }
diff --git 
a/mode/type/standalone/repository/provider/jdbc/core/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/provider/JDBCRepositoryProvider.java
 
b/mode/type/standalone/repository/provider/jdbc/core/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/provider/JDBCRepositoryProvider.java
index c8319464af7..de68e347084 100644
--- 
a/mode/type/standalone/repository/provider/jdbc/core/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/provider/JDBCRepositoryProvider.java
+++ 
b/mode/type/standalone/repository/provider/jdbc/core/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/provider/JDBCRepositoryProvider.java
@@ -18,14 +18,13 @@
 package org.apache.shardingsphere.mode.repository.standalone.jdbc.provider;
 
 import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
 /**
  * JDBC repository provider.
  */
 @SingletonSPI
-public interface JDBCRepositoryProvider extends TypedSPI, RequiredSPI {
+public interface JDBCRepositoryProvider extends TypedSPI {
     
     /**
      * Drop table SQL.
diff --git 
a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/header/query/QueryHeaderBuilder.java
 
b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/header/query/QueryHeaderBuilder.java
index c68e86c718a..155d0a0624d 100644
--- 
a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/header/query/QueryHeaderBuilder.java
+++ 
b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/header/query/QueryHeaderBuilder.java
@@ -20,7 +20,6 @@ package 
org.apache.shardingsphere.proxy.backend.response.header.query;
 import 
org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResultMetaData;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
-import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
 import java.sql.SQLException;
@@ -29,7 +28,7 @@ import java.sql.SQLException;
  * Query header builder.
  */
 @SingletonSPI
-public interface QueryHeaderBuilder extends TypedSPI, RequiredSPI {
+public interface QueryHeaderBuilder extends TypedSPI {
     
     /**
      * Build query header.

Reply via email to