ALTER READWRITE_SPLITTING RULE

Description

The ALTER READWRITE_SPLITTING RULE syntax is used to alter a readwrite-splitting rule.

Syntax

Grammar Railroad diagram

  1. AlterReadwriteSplittingRule ::=
  2. 'ALTER' 'READWRITE_SPLITTING' 'RULE' readwriteSplittingDefinition (',' readwriteSplittingDefinition)*
  3. readwriteSplittingDefinition ::=
  4. ruleName '(' dataSourceDefinition (',' transactionalReadQueryStrategyDefinition)? (',' loadBalancerDefinition)? ')'
  5. dataSourceDefinition ::=
  6. 'WRITE_STORAGE_UNIT' '=' writeStorageUnitName ',' 'READ_STORAGE_UNITS' '(' storageUnitName (',' storageUnitName)* ')'
  7. transactionalReadQueryStrategyDefinition ::=
  8. 'TRANSACTIONAL_READ_QUERY_STRATEGY' '=' transactionalReadQueryStrategyType
  9. loadBalancerDefinition ::=
  10. 'TYPE' '(' 'NAME' '=' loadBalancerType (',' propertiesDefinition)? ')'
  11. ruleName ::=
  12. identifier
  13. writeStorageUnitName ::=
  14. identifier
  15. storageUnitName ::=
  16. identifier
  17. transactionalReadQueryStrategyType ::=
  18. string
  19. loadBalancerType ::=
  20. string
  21. propertiesDefinition ::=
  22. 'PROPERTIES' '(' key '=' value (',' key '=' value)* ')'
  23. key ::=
  24. string
  25. value ::=
  26. literal

Supplement

  • transactionalReadQueryStrategyType specifies the routing strategy for read query within a transaction, please refer to YAML configuration;
  • loadBalancerType specifies the load balancing algorithm type, please refer to Load Balance Algorithm.

Example

Alter a readwrite-splitting rule

  1. ALTER READWRITE_SPLITTING RULE ms_group_0 (
  2. WRITE_STORAGE_UNIT=write_ds,
  3. READ_STORAGE_UNITS(read_ds_0,read_ds_1),
  4. TYPE(NAME="random")
  5. );

Reserved word

ALTER, READWRITE_SPLITTING, RULE, WRITE_STORAGE_UNIT, READ_STORAGE_UNITS , TYPE, NAME, PROPERTIES, TRUE, FALSE