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 '(' (staticReadwriteSplittingDefinition | dynamicReadwriteSplittingDefinition) (',' loadBalancerDefinition)? ')'
  5. staticReadwriteSplittingDefinition ::=
  6. 'WRITE_STORAGE_UNIT' '=' writeStorageUnitName ',' 'READ_STORAGE_UNITS' '(' storageUnitName (',' storageUnitName)* ')'
  7. dynamicReadwriteSplittingDefinition ::=
  8. 'AUTO_AWARE_RESOURCE' '=' resourceName
  9. loadBalancerDefinition ::=
  10. 'TYPE' '(' 'NAME' '=' loadBalancerType (',' propertiesDefinition)? ')'
  11. ruleName ::=
  12. identifier
  13. writeStorageUnitName ::=
  14. identifier
  15. storageUnitName ::=
  16. identifier
  17. resourceName ::=
  18. identifier
  19. loadBalancerType ::=
  20. string
  21. propertiesDefinition ::=
  22. 'PROPERTIES' '(' key '=' value (',' key '=' value)* ')'
  23. key ::=
  24. string
  25. value ::=
  26. literal

Supplement

  • Dynamic readwrite-splitting rules rely on database discovery rules;
  • loadBalancerType specifies the load balancing algorithm type, please refer to Load Balance Algorithm);

Example

Alter a statics 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. );

Alter a dynamic readwrite splitting rule

  1. ALTER READWRITE_SPLITTING RULE ms_group_1 (
  2. AUTO_AWARE_RESOURCE=group_0,
  3. TYPE(NAME="random")
  4. );

Reserved word

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