sandynz commented on a change in pull request #15407:
URL: https://github.com/apache/shardingsphere/pull/15407#discussion_r806521450
##########
File path:
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/rule/RuleDefinitionBackendHandler.java
##########
@@ -17,6 +17,8 @@
package org.apache.shardingsphere.proxy.backend.text.distsql.rdl.rule;
+import com.google.common.collect.Sets;
+import com.sun.javafx.runtime.SystemProperties;
Review comment:
`com.sun.javafx.runtime.SystemProperties` is not necessary.
##########
File path:
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/rule/RuleDefinitionBackendHandler.java
##########
@@ -68,7 +79,11 @@ protected ResponseHeader execute(final String schemaName,
final T sqlStatement)
ruleDefinitionUpdater.checkSQLStatement(shardingSphereMetaData,
sqlStatement, currentRuleConfig);
Optional<RuleDefinitionAlterPreprocessor> preprocessor =
TypedSPIRegistry.findRegisteredService(RuleDefinitionAlterPreprocessor.class,
sqlStatement.getClass().getCanonicalName(),
new Properties());
- if
(RuleAlteredJobWorker.isOnRuleAlteredActionEnabled(currentRuleConfig) &&
preprocessor.isPresent()) {
+ if
(!RuleAlteredJobWorker.isOnRuleAlteredActionEnabled(currentRuleConfig)) {
+ if
(RULE_ALTERED_ACTION_LIST.contains(sqlStatement.getClass().getCanonicalName()))
{
+ throw new RuntimeException("scaling is not enabled");
+ }
+ } else if
(RuleAlteredJobWorker.isOnRuleAlteredActionEnabled(currentRuleConfig) &&
preprocessor.isPresent()) {
Review comment:
There's still duplicated call of
`RuleAlteredJobWorker.isOnRuleAlteredActionEnabled`.
--
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]