vikiuvb commented on code in PR #22857:
URL: https://github.com/apache/shardingsphere/pull/22857#discussion_r1058850252


##########
features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/ShardingConditionEngine.java:
##########
@@ -21,11 +21,22 @@
 import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
 
 import java.util.List;
+import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
+import org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPI;
+import org.apache.shardingsphere.sharding.rule.ShardingRule;
 
 /**
  * Sharding condition engine.
  */
-public interface ShardingConditionEngine<T extends SQLStatementContext<?>> {
+public interface ShardingConditionEngine<T extends SQLStatementContext<?>> 
extends RequiredSPI {
+    
+    /**
+     * Initialize the sharding condition engine.
+     *
+     * @param rule sharding rule
+     * @param database sharding database
+     */
+    void init(ShardingRule rule, ShardingSphereDatabase database);

Review Comment:
   @strongduanmu The Java `ServiceLoader` implementation requires a class with 
a default constructor, so we cannot have a parameterized constructor `public 
DefaultShardingConditionEngine(final ShardingRule rule, final 
ShardingSphereDatabase database)`.  The method `void init(ShardingRule rule, 
ShardingSphereDatabase database)` is added to allow the implementation class to 
prepare its internal structures. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to