RaigorJiang commented on a change in pull request #15466:
URL: https://github.com/apache/shardingsphere/pull/15466#discussion_r808892309
##########
File path:
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/updatable/RefreshTableMetadataHandler.java
##########
@@ -15,41 +15,52 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.proxy.backend.text.distsql.ral.common;
+package
org.apache.shardingsphere.proxy.backend.text.distsql.ral.common.updatable;
-import lombok.Getter;
import
org.apache.shardingsphere.distsql.parser.statement.ral.common.RefreshTableMetadataStatement;
+import org.apache.shardingsphere.infra.distsql.exception.DistSQLException;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import org.apache.shardingsphere.proxy.backend.response.header.ResponseHeader;
-import
org.apache.shardingsphere.proxy.backend.response.header.update.UpdateResponseHeader;
+import
org.apache.shardingsphere.proxy.backend.exception.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.proxy.backend.exception.UnknownDatabaseException;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
-import
org.apache.shardingsphere.proxy.backend.text.SchemaRequiredBackendHandler;
-
-import java.sql.SQLException;
+import
org.apache.shardingsphere.proxy.backend.text.distsql.ral.UpdatableRALBackendHandler;
/**
* Refresh table metadata handler.
*/
-@Getter
-public final class RefreshTableMetadataHandler extends
SchemaRequiredBackendHandler<RefreshTableMetadataStatement> {
+public final class RefreshTableMetadataHandler extends
UpdatableRALBackendHandler<RefreshTableMetadataStatement,
RefreshTableMetadataHandler> {
+
+ private ConnectionSession connectionSession;
- public RefreshTableMetadataHandler(final RefreshTableMetadataStatement
sqlStatement, final ConnectionSession connectionSession) {
- super(sqlStatement, connectionSession);
+ @Override
+ public RefreshTableMetadataHandler init(final
HandlerParameter<RefreshTableMetadataStatement> parameter) {
+ sqlStatement = parameter.getStatement();
+ connectionSession = parameter.getConnectionSession();
+ return this;
}
@Override
- protected ResponseHeader execute(final String schemaName, final
RefreshTableMetadataStatement sqlStatement) throws SQLException {
- ContextManager contextManager =
ProxyContext.getInstance().getContextManager();
+ protected void doHandle(final ContextManager contextManager, final
RefreshTableMetadataStatement sqlStatement) throws DistSQLException {
Review comment:
`doHandle` is a strange name, execute is better.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]