Class ShadowRuleStatementChecker

java.lang.Object
org.apache.shardingsphere.shadow.distsql.handler.checker.ShadowRuleStatementChecker

public class ShadowRuleStatementChecker extends Object
Shadow rule statement checker.
  • Field Details

  • Constructor Details

    • ShadowRuleStatementChecker

      public ShadowRuleStatementChecker()
  • Method Details

    • checkConfigurationExist

      public static void checkConfigurationExist(String databaseName, org.apache.shardingsphere.infra.config.scope.SchemaRuleConfiguration config) throws org.apache.shardingsphere.infra.distsql.exception.DistSQLException
      Check if the configuration exists.
      Parameters:
      databaseName - database name
      config - configuration
      Throws:
      org.apache.shardingsphere.infra.distsql.exception.DistSQLException - DistSQL exception
    • checkResourceExist

      public static void checkResourceExist(Collection<String> resources, org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase database) throws org.apache.shardingsphere.infra.distsql.exception.DistSQLException
      Check if resources exist in meta data.
      Parameters:
      resources - resource being checked
      database - database
      Throws:
      org.apache.shardingsphere.infra.distsql.exception.DistSQLException - DistSQL exception
    • checkAlgorithmCompleteness

      public static void checkAlgorithmCompleteness(Collection<ShadowAlgorithmSegment> algorithmSegments) throws org.apache.shardingsphere.infra.distsql.exception.DistSQLException
      Check the completeness of the algorithm.
      Parameters:
      algorithmSegments - algorithmSegments to be checked
      Throws:
      org.apache.shardingsphere.infra.distsql.exception.DistSQLException - DistSQL exception
    • checkRulesExist

      public static void checkRulesExist(Collection<String> requireRules, Collection<String> currentRules, Function<Collection<String>,org.apache.shardingsphere.infra.distsql.exception.DistSQLException> thrower) throws org.apache.shardingsphere.infra.distsql.exception.DistSQLException
      Check if the rules exist.
      Parameters:
      requireRules - require rules
      currentRules - current rules
      thrower - thrower
      Throws:
      org.apache.shardingsphere.infra.distsql.exception.DistSQLException - DistSQL exception
    • checkAlgorithmExist

      public static void checkAlgorithmExist(Collection<String> requireAlgorithms, Collection<String> currentAlgorithms, Function<Collection<String>,org.apache.shardingsphere.infra.distsql.exception.DistSQLException> thrower) throws org.apache.shardingsphere.infra.distsql.exception.DistSQLException
      Check if the algorithms exist.
      Parameters:
      requireAlgorithms - require algorithms
      currentAlgorithms - current algorithms
      thrower - thrower
      Throws:
      org.apache.shardingsphere.infra.distsql.exception.DistSQLException - DistSQL exception
    • checkAnyDuplicate

      public static void checkAnyDuplicate(Collection<String> rules, Function<Collection<String>,org.apache.shardingsphere.infra.distsql.exception.DistSQLException> thrower) throws org.apache.shardingsphere.infra.distsql.exception.DistSQLException
      Check for any duplicate data in the rules, and throw the specified exception.
      Parameters:
      rules - rules to be checked
      thrower - exception thrower
      Throws:
      org.apache.shardingsphere.infra.distsql.exception.DistSQLException - DistSQL exception
    • checkAnyDuplicate

      public static void checkAnyDuplicate(Collection<String> requireRules, Collection<String> currentRules, Function<Collection<String>,org.apache.shardingsphere.infra.distsql.exception.DistSQLException> thrower) throws org.apache.shardingsphere.infra.distsql.exception.DistSQLException
      Check if there are duplicates in the rules, and throw the specified exception.
      Parameters:
      requireRules - rules to be checked
      currentRules - rules to be checked
      thrower - exception thrower
      Throws:
      org.apache.shardingsphere.infra.distsql.exception.DistSQLException - DistSQL exception
    • checkAnyDifferent

      public static void checkAnyDifferent(Collection<String> requireRules, Collection<String> currentRules, Function<Collection<String>,org.apache.shardingsphere.infra.distsql.exception.DistSQLException> thrower) throws org.apache.shardingsphere.infra.distsql.exception.DistSQLException
      Check for any different data in the rules, and throw the specified exception.
      Parameters:
      requireRules - rules to be checked
      currentRules - rules to be checked
      thrower - exception thrower
      Throws:
      org.apache.shardingsphere.infra.distsql.exception.DistSQLException - DistSQL exception