sandynz commented on issue #12485:
URL: 
https://github.com/apache/shardingsphere/issues/12485#issuecomment-922178576


   In `RALBackendHandlerFactory.java`
   ```
       public static TextProtocolBackendHandler newInstance(final RALStatement 
sqlStatement, final BackendConnection backendConnection) throws SQLException {
           if (sqlStatement instanceof QueryableRALStatement) {
               return 
QueryableRALBackendHandlerFactory.newInstance((QueryableRALStatement) 
sqlStatement, backendConnection);
           }
           if (sqlStatement instanceof UpdatableRALStatement) {
               return 
UpdatableRALBackendHandlerFactory.newInstance((UpdatableRALStatement) 
sqlStatement);
           }
           if (sqlStatement instanceof CommonDistSQLStatement) {
               return 
CommonDistSQLBackendHandlerFactory.newInstance((CommonDistSQLStatement) 
sqlStatement, backendConnection);
           }
           if (sqlStatement instanceof AdvancedDistSQLStatement) {
               return 
AdvancedDistSQLBackendHandlerFactory.newInstance((AdvancedDistSQLStatement) 
sqlStatement, backendConnection);
           }
           throw new 
UnsupportedOperationException(sqlStatement.getClass().getCanonicalName());
       }
   ```
   
   Currently, `UpdatableRALStatement` sub-classes are: 
`DropScalingJobStatement`, `ResetScalingJobStatement`, 
`StartScalingJobStatement`, `StopScalingJobStatement`, all of them belong to 
scaling feature.
   
   If new sub-class of `UpdatableRALStatement` is added in other feature and 
scaling feature is not enabled, `checkServerConfig()` in scaling will have side 
effect.
   
   Possible solution:
   - Move `checkServerConfig()` outside of `ScalingAPIFactory`, check it in 
`ScalingWorker.init` could be 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]


Reply via email to