diff --git a/infra/context/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher b/infra/context/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher deleted file mode 100644 index 67c3d8008319e..0000000000000 --- a/infra/context/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher +++ /dev/null @@ -1,30 +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.connection.refresher.type.schema.CreateSchemaStatementSchemaRefresher -org.apache.shardingsphere.infra.connection.refresher.type.schema.AlterSchemaStatementSchemaRefresher -org.apache.shardingsphere.infra.connection.refresher.type.schema.DropSchemaStatementSchemaRefresher -org.apache.shardingsphere.infra.connection.refresher.type.index.CreateIndexStatementSchemaRefresher -org.apache.shardingsphere.infra.connection.refresher.type.index.AlterIndexStatementSchemaRefresher -org.apache.shardingsphere.infra.connection.refresher.type.index.DropIndexStatementSchemaRefresher -org.apache.shardingsphere.infra.connection.refresher.type.view.CreateViewStatementSchemaRefresher -org.apache.shardingsphere.infra.connection.refresher.type.view.AlterViewStatementSchemaRefresher -org.apache.shardingsphere.infra.connection.refresher.type.view.DropViewStatementSchemaRefresher -org.apache.shardingsphere.infra.connection.refresher.type.table.CreateTableStatementSchemaRefresher -org.apache.shardingsphere.infra.connection.refresher.type.table.AlterTableStatementSchemaRefresher -org.apache.shardingsphere.infra.connection.refresher.type.table.RenameTableStatementSchemaRefresher -org.apache.shardingsphere.infra.connection.refresher.type.table.DropTableStatementSchemaRefresher diff --git a/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/DriverJDBCExecutor.java b/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/DriverJDBCExecutor.java index 30c3211554cbc..daa416843af4e 100644 --- a/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/DriverJDBCExecutor.java +++ b/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/DriverJDBCExecutor.java @@ -19,7 +19,6 @@ import org.apache.shardingsphere.driver.executor.callback.ExecuteQueryCallback; import org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext; -import org.apache.shardingsphere.infra.connection.refresher.MetaDataRefreshEngine; import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroupContext; import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutionUnit; import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor; @@ -33,6 +32,7 @@ import org.apache.shardingsphere.infra.session.query.QueryContext; import org.apache.shardingsphere.mode.manager.ContextManager; import org.apache.shardingsphere.mode.metadata.MetaDataContexts; +import org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefreshEngine; import java.sql.SQLException; import java.util.Collection; diff --git a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/context/ResourceMetaDataContextManager.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/context/ResourceMetaDataContextManager.java index d4ca38f4f47c6..a7d02ddbd3bd6 100644 --- a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/context/ResourceMetaDataContextManager.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/context/ResourceMetaDataContextManager.java @@ -19,7 +19,6 @@ import com.google.common.base.Strings; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.infra.connection.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.infra.database.DatabaseTypeEngine; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; @@ -31,6 +30,7 @@ import org.apache.shardingsphere.infra.rule.scope.GlobalRule; import org.apache.shardingsphere.infra.rule.scope.GlobalRule.GlobalRuleChangedType; import org.apache.shardingsphere.mode.metadata.MetaDataContexts; +import org.apache.shardingsphere.mode.metadata.refresher.util.TableRefreshUtils; import java.util.Collections; import java.util.Optional; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/MetaDataRefreshEngine.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/MetaDataRefreshEngine.java similarity index 98% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/MetaDataRefreshEngine.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/MetaDataRefreshEngine.java index ce7d1b53a58ad..385e194492444 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/MetaDataRefreshEngine.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/MetaDataRefreshEngine.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher; +package org.apache.shardingsphere.mode.metadata.refresher; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/MetaDataRefresher.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/MetaDataRefresher.java similarity index 97% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/MetaDataRefresher.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/MetaDataRefresher.java index 4af21f6b2eb57..e9f00df3fcc36 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/MetaDataRefresher.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/MetaDataRefresher.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher; +package org.apache.shardingsphere.mode.metadata.refresher; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/index/AlterIndexStatementSchemaRefresher.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/index/AlterIndexStatementSchemaRefresher.java similarity index 96% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/index/AlterIndexStatementSchemaRefresher.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/index/AlterIndexStatementSchemaRefresher.java index f5f6243186216..9d91447d24b9b 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/index/AlterIndexStatementSchemaRefresher.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/index/AlterIndexStatementSchemaRefresher.java @@ -15,11 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher.type.index; +package org.apache.shardingsphere.mode.metadata.refresher.type.index; import com.google.common.base.Preconditions; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.instance.mode.ModeContextManager; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; @@ -27,6 +26,7 @@ import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable; import org.apache.shardingsphere.infra.metadata.database.schema.pojo.AlterSchemaMetaDataPOJO; +import org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher; import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment; import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.AlterIndexStatement; import org.apache.shardingsphere.sql.parser.sql.dialect.handler.ddl.AlterIndexStatementHandler; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/index/CreateIndexStatementSchemaRefresher.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/index/CreateIndexStatementSchemaRefresher.java similarity index 95% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/index/CreateIndexStatementSchemaRefresher.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/index/CreateIndexStatementSchemaRefresher.java index 4c720d88e1ed6..0a4dba15d710a 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/index/CreateIndexStatementSchemaRefresher.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/index/CreateIndexStatementSchemaRefresher.java @@ -15,11 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher.type.index; +package org.apache.shardingsphere.mode.metadata.refresher.type.index; import com.google.common.base.Strings; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.instance.mode.ModeContextManager; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; @@ -27,6 +26,7 @@ import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable; import org.apache.shardingsphere.infra.metadata.database.schema.pojo.AlterSchemaMetaDataPOJO; import org.apache.shardingsphere.infra.metadata.database.schema.util.IndexMetaDataUtils; +import org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher; import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CreateIndexStatement; import java.util.Collection; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/index/DropIndexStatementSchemaRefresher.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/index/DropIndexStatementSchemaRefresher.java similarity index 96% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/index/DropIndexStatementSchemaRefresher.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/index/DropIndexStatementSchemaRefresher.java index 8c91b428a9341..3cced6664b623 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/index/DropIndexStatementSchemaRefresher.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/index/DropIndexStatementSchemaRefresher.java @@ -15,10 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher.type.index; +package org.apache.shardingsphere.mode.metadata.refresher.type.index; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.instance.mode.ModeContextManager; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; @@ -26,6 +25,7 @@ import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable; import org.apache.shardingsphere.infra.metadata.database.schema.pojo.AlterSchemaMetaDataPOJO; import org.apache.shardingsphere.infra.metadata.database.schema.util.IndexMetaDataUtils; +import org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher; import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment; import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DropIndexStatement; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/schema/AlterSchemaStatementSchemaRefresher.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/schema/AlterSchemaStatementSchemaRefresher.java similarity index 94% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/schema/AlterSchemaStatementSchemaRefresher.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/schema/AlterSchemaStatementSchemaRefresher.java index 6c95281bae9d1..287aed09f718c 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/schema/AlterSchemaStatementSchemaRefresher.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/schema/AlterSchemaStatementSchemaRefresher.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher.type.schema; +package org.apache.shardingsphere.mode.metadata.refresher.type.schema; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.instance.mode.ModeContextManager; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.schema.pojo.AlterSchemaPOJO; +import org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher; import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.AlterSchemaStatement; import org.apache.shardingsphere.sql.parser.sql.dialect.handler.ddl.AlterSchemaStatementHandler; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/schema/CreateSchemaStatementSchemaRefresher.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/schema/CreateSchemaStatementSchemaRefresher.java similarity index 93% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/schema/CreateSchemaStatementSchemaRefresher.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/schema/CreateSchemaStatementSchemaRefresher.java index 5a6cd8437775c..7989eaa15c89e 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/schema/CreateSchemaStatementSchemaRefresher.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/schema/CreateSchemaStatementSchemaRefresher.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher.type.schema; +package org.apache.shardingsphere.mode.metadata.refresher.type.schema; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.instance.mode.ModeContextManager; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; +import org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher; import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CreateSchemaStatement; import org.apache.shardingsphere.sql.parser.sql.dialect.handler.ddl.CreateSchemaStatementHandler; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/schema/DropSchemaStatementSchemaRefresher.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/schema/DropSchemaStatementSchemaRefresher.java similarity index 93% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/schema/DropSchemaStatementSchemaRefresher.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/schema/DropSchemaStatementSchemaRefresher.java index 2c42d3672c60a..f7c8aded79da7 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/schema/DropSchemaStatementSchemaRefresher.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/schema/DropSchemaStatementSchemaRefresher.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher.type.schema; +package org.apache.shardingsphere.mode.metadata.refresher.type.schema; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.instance.mode.ModeContextManager; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; +import org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher; import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DropSchemaStatement; import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/table/AlterTableStatementSchemaRefresher.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/table/AlterTableStatementSchemaRefresher.java similarity index 95% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/table/AlterTableStatementSchemaRefresher.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/table/AlterTableStatementSchemaRefresher.java index f44096bed3203..606844881af0d 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/table/AlterTableStatementSchemaRefresher.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/table/AlterTableStatementSchemaRefresher.java @@ -15,11 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher.type.table; +package org.apache.shardingsphere.mode.metadata.refresher.type.table; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher; -import org.apache.shardingsphere.infra.connection.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.instance.mode.ModeContextManager; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; @@ -30,6 +28,8 @@ import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable; import org.apache.shardingsphere.infra.metadata.database.schema.pojo.AlterSchemaMetaDataPOJO; import org.apache.shardingsphere.infra.rule.attribute.datanode.MutableDataNodeRuleAttribute; +import org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher; +import org.apache.shardingsphere.mode.metadata.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.AlterTableStatement; import java.sql.SQLException; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/table/CreateTableStatementSchemaRefresher.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/table/CreateTableStatementSchemaRefresher.java similarity index 94% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/table/CreateTableStatementSchemaRefresher.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/table/CreateTableStatementSchemaRefresher.java index 809f14ca00353..5fd8e2bc41ff1 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/table/CreateTableStatementSchemaRefresher.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/table/CreateTableStatementSchemaRefresher.java @@ -15,11 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher.type.table; +package org.apache.shardingsphere.mode.metadata.refresher.type.table; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher; -import org.apache.shardingsphere.infra.connection.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.instance.mode.ModeContextManager; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; @@ -30,6 +28,8 @@ import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable; import org.apache.shardingsphere.infra.metadata.database.schema.pojo.AlterSchemaMetaDataPOJO; import org.apache.shardingsphere.infra.rule.attribute.datanode.MutableDataNodeRuleAttribute; +import org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher; +import org.apache.shardingsphere.mode.metadata.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CreateTableStatement; import java.sql.SQLException; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/table/DropTableStatementSchemaRefresher.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/table/DropTableStatementSchemaRefresher.java similarity index 92% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/table/DropTableStatementSchemaRefresher.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/table/DropTableStatementSchemaRefresher.java index 3c6b733ff5fc9..136c9d5d1797d 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/table/DropTableStatementSchemaRefresher.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/table/DropTableStatementSchemaRefresher.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher.type.table; +package org.apache.shardingsphere.mode.metadata.refresher.type.table; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher; -import org.apache.shardingsphere.infra.connection.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.instance.mode.ModeContextManager; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.schema.pojo.AlterSchemaMetaDataPOJO; +import org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher; +import org.apache.shardingsphere.mode.metadata.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment; import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DropTableStatement; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/table/RenameTableStatementSchemaRefresher.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/table/RenameTableStatementSchemaRefresher.java similarity index 95% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/table/RenameTableStatementSchemaRefresher.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/table/RenameTableStatementSchemaRefresher.java index 48c9e518ab105..d357e623319ed 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/table/RenameTableStatementSchemaRefresher.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/table/RenameTableStatementSchemaRefresher.java @@ -15,11 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher.type.table; +package org.apache.shardingsphere.mode.metadata.refresher.type.table; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher; -import org.apache.shardingsphere.infra.connection.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.instance.mode.ModeContextManager; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; @@ -30,6 +28,8 @@ import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable; import org.apache.shardingsphere.infra.metadata.database.schema.pojo.AlterSchemaMetaDataPOJO; import org.apache.shardingsphere.infra.rule.attribute.datanode.MutableDataNodeRuleAttribute; +import org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher; +import org.apache.shardingsphere.mode.metadata.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.table.RenameTableDefinitionSegment; import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.RenameTableStatement; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/view/AlterViewStatementSchemaRefresher.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/view/AlterViewStatementSchemaRefresher.java similarity index 96% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/view/AlterViewStatementSchemaRefresher.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/view/AlterViewStatementSchemaRefresher.java index 0bf9f2da574a4..6df2f299c57ad 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/view/AlterViewStatementSchemaRefresher.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/view/AlterViewStatementSchemaRefresher.java @@ -15,11 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher.type.view; +package org.apache.shardingsphere.mode.metadata.refresher.type.view; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher; -import org.apache.shardingsphere.infra.connection.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.instance.mode.ModeContextManager; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; @@ -31,6 +29,8 @@ import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereView; import org.apache.shardingsphere.infra.metadata.database.schema.pojo.AlterSchemaMetaDataPOJO; import org.apache.shardingsphere.infra.rule.attribute.datanode.MutableDataNodeRuleAttribute; +import org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher; +import org.apache.shardingsphere.mode.metadata.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment; import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.AlterViewStatement; import org.apache.shardingsphere.sql.parser.sql.dialect.handler.ddl.AlterViewStatementHandler; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/view/CreateViewStatementSchemaRefresher.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/view/CreateViewStatementSchemaRefresher.java similarity index 94% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/view/CreateViewStatementSchemaRefresher.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/view/CreateViewStatementSchemaRefresher.java index 9d2b99e9a83ef..60a3bc417147b 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/view/CreateViewStatementSchemaRefresher.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/view/CreateViewStatementSchemaRefresher.java @@ -15,11 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher.type.view; +package org.apache.shardingsphere.mode.metadata.refresher.type.view; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher; -import org.apache.shardingsphere.infra.connection.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.instance.mode.ModeContextManager; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; @@ -31,6 +29,8 @@ import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereView; import org.apache.shardingsphere.infra.metadata.database.schema.pojo.AlterSchemaMetaDataPOJO; import org.apache.shardingsphere.infra.rule.attribute.datanode.MutableDataNodeRuleAttribute; +import org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher; +import org.apache.shardingsphere.mode.metadata.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CreateViewStatement; import java.sql.SQLException; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/view/DropViewStatementSchemaRefresher.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/view/DropViewStatementSchemaRefresher.java similarity index 94% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/view/DropViewStatementSchemaRefresher.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/view/DropViewStatementSchemaRefresher.java index b5230b194e042..e5c77ce59f8e2 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/type/view/DropViewStatementSchemaRefresher.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/view/DropViewStatementSchemaRefresher.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher.type.view; +package org.apache.shardingsphere.mode.metadata.refresher.type.view; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.connection.refresher.MetaDataRefresher; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.instance.mode.ModeContextManager; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.schema.pojo.AlterSchemaMetaDataPOJO; +import org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher; import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DropViewStatement; import java.util.Collection; diff --git a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/util/TableRefreshUtils.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/util/TableRefreshUtils.java similarity index 98% rename from infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/util/TableRefreshUtils.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/util/TableRefreshUtils.java index 048f25333e193..76a8e6bece3f0 100644 --- a/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/refresher/util/TableRefreshUtils.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/util/TableRefreshUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.connection.refresher.util; +package org.apache.shardingsphere.mode.metadata.refresher.util; import com.google.common.base.Joiner; import lombok.AccessLevel; diff --git a/mode/core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher b/mode/core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher new file mode 100644 index 0000000000000..079d469f2cd0e --- /dev/null +++ b/mode/core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefresher @@ -0,0 +1,30 @@ +# +# 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.mode.metadata.refresher.type.schema.CreateSchemaStatementSchemaRefresher +org.apache.shardingsphere.mode.metadata.refresher.type.schema.AlterSchemaStatementSchemaRefresher +org.apache.shardingsphere.mode.metadata.refresher.type.schema.DropSchemaStatementSchemaRefresher +org.apache.shardingsphere.mode.metadata.refresher.type.index.CreateIndexStatementSchemaRefresher +org.apache.shardingsphere.mode.metadata.refresher.type.index.AlterIndexStatementSchemaRefresher +org.apache.shardingsphere.mode.metadata.refresher.type.index.DropIndexStatementSchemaRefresher +org.apache.shardingsphere.mode.metadata.refresher.type.view.CreateViewStatementSchemaRefresher +org.apache.shardingsphere.mode.metadata.refresher.type.view.AlterViewStatementSchemaRefresher +org.apache.shardingsphere.mode.metadata.refresher.type.view.DropViewStatementSchemaRefresher +org.apache.shardingsphere.mode.metadata.refresher.type.table.CreateTableStatementSchemaRefresher +org.apache.shardingsphere.mode.metadata.refresher.type.table.AlterTableStatementSchemaRefresher +org.apache.shardingsphere.mode.metadata.refresher.type.table.RenameTableStatementSchemaRefresher +org.apache.shardingsphere.mode.metadata.refresher.type.table.DropTableStatementSchemaRefresher diff --git a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneModeContextManager.java b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneModeContextManager.java index 716cd34548e18..9d26da9662501 100644 --- a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneModeContextManager.java +++ b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneModeContextManager.java @@ -20,7 +20,6 @@ import com.google.common.base.Strings; import lombok.Setter; import org.apache.shardingsphere.infra.config.rule.RuleConfiguration; -import org.apache.shardingsphere.infra.connection.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.infra.datasource.pool.props.domain.DataSourcePoolProperties; import org.apache.shardingsphere.infra.instance.mode.ModeContextManager; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; @@ -45,6 +44,7 @@ import org.apache.shardingsphere.mode.manager.switcher.SwitchingResource; import org.apache.shardingsphere.mode.metadata.MetaDataContexts; import org.apache.shardingsphere.mode.metadata.builder.RuleConfigurationEventBuilder; +import org.apache.shardingsphere.mode.metadata.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.single.api.config.SingleRuleConfiguration; import java.sql.SQLException; diff --git a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/service/StandaloneMetaDataManagerPersistService.java b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/service/StandaloneMetaDataManagerPersistService.java index dbe5b0d5d18f5..1099ebf8b87a8 100644 --- a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/service/StandaloneMetaDataManagerPersistService.java +++ b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/service/StandaloneMetaDataManagerPersistService.java @@ -19,7 +19,6 @@ import com.google.common.base.Strings; import org.apache.shardingsphere.infra.config.rule.RuleConfiguration; -import org.apache.shardingsphere.infra.connection.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.infra.datasource.pool.props.domain.DataSourcePoolProperties; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; @@ -42,6 +41,7 @@ import org.apache.shardingsphere.mode.manager.switcher.SwitchingResource; import org.apache.shardingsphere.mode.metadata.MetaDataContexts; import org.apache.shardingsphere.mode.metadata.builder.RuleConfigurationEventBuilder; +import org.apache.shardingsphere.mode.metadata.refresher.util.TableRefreshUtils; import org.apache.shardingsphere.mode.service.MetaDataManagerPersistService; import org.apache.shardingsphere.single.api.config.SingleRuleConfiguration; diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/DatabaseConnector.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/DatabaseConnector.java index a2678efd5ffc0..3ae4b4f118b07 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/DatabaseConnector.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/DatabaseConnector.java @@ -28,7 +28,6 @@ import org.apache.shardingsphere.infra.binder.context.type.CursorAvailable; import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey; import org.apache.shardingsphere.infra.connection.kernel.KernelProcessor; -import org.apache.shardingsphere.infra.connection.refresher.MetaDataRefreshEngine; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions; import org.apache.shardingsphere.infra.exception.dialect.SQLExceptionTransformEngine; @@ -52,6 +51,7 @@ import org.apache.shardingsphere.infra.session.query.QueryContext; import org.apache.shardingsphere.mode.manager.ContextManager; import org.apache.shardingsphere.mode.metadata.MetaDataContexts; +import org.apache.shardingsphere.mode.metadata.refresher.MetaDataRefreshEngine; import org.apache.shardingsphere.proxy.backend.connector.jdbc.executor.callback.ProxyJDBCExecutorCallback; import org.apache.shardingsphere.proxy.backend.connector.jdbc.executor.callback.ProxyJDBCExecutorCallbackFactory; import org.apache.shardingsphere.proxy.backend.connector.jdbc.statement.JDBCBackendStatement;