yu199195 commented on a change in pull request #5019:  ues strategy pattern 
modify refresh ShardingMetaData.
URL: 
https://github.com/apache/incubator-shardingsphere/pull/5019#discussion_r400825040
 
 

 ##########
 File path: 
sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/refreh/SQLStatementMetaDataRefreshFactory.java
 ##########
 @@ -0,0 +1,39 @@
+package org.apache.shardingsphere.shardingjdbc.jdbc.refreh;
+
+import 
org.apache.shardingsphere.sql.parser.binder.statement.SQLStatementContext;
+import 
org.apache.shardingsphere.sql.parser.binder.statement.ddl.AlterTableStatementContext;
+import 
org.apache.shardingsphere.sql.parser.binder.statement.ddl.CreateIndexStatementContext;
+import 
org.apache.shardingsphere.sql.parser.binder.statement.ddl.CreateTableStatementContext;
+import 
org.apache.shardingsphere.sql.parser.binder.statement.ddl.DropIndexStatementContext;
+import 
org.apache.shardingsphere.sql.parser.binder.statement.ddl.DropTableStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.statement.SQLStatement;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+/**
+ * The type Sql statement meta data refresh factory.
+ */
+public final class SQLStatementMetaDataRefreshFactory {
+    
+    private static final Map<Class<?>, SQLStatementMetaDataRefresh<? extends 
SQLStatement>> REFRESH_MAP = new HashMap<>();
+    
+    static {
+        REFRESH_MAP.put(CreateTableStatementContext.class, new 
CreateTableStatementMetaDataRefresh());
+        REFRESH_MAP.put(AlterTableStatementContext.class, new 
AlterTableStatementMetaDataRefresh());
+        REFRESH_MAP.put(DropTableStatementContext.class, new 
DropTableStatementMetaDataRefresh());
+        REFRESH_MAP.put(CreateIndexStatementContext.class, new 
CreateIndexStatementMetaDataRefresh());
+        REFRESH_MAP.put(DropIndexStatementContext.class, new 
DropIndexStatementMetaDataRefresh());
+    }
+    
+    /**
+     * New instance sql statement meta data refresh.
 
 Review comment:
   fix.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to