ALTER TRAFFIC RULE
描述
ALTER TRAFFIC RULE
语法用于修改双路由规则。
语法定义
语法 铁路图
AlterTrafficRule ::=
'ALTER' 'TRAFFIC' 'RULE' '(' 'LABELS' '(' lableName ')' ',' trafficAlgorithmDefinition ',' loadBalancerDefinition ')'
lableName ::=
identifier
trafficAlgorithmDefinition ::=
'TRAFFIC_ALGORITHM' '(' 'TYPE' '(' 'NAME' '=' trafficAlgorithmTypeName (',' propertiesDefinition)? ')' ')'
loadBalancerDefinition ::=
'LOAD_BALANCER' '(' 'TYPE' '(' 'NAME' '=' loadBalancerName (',' propertiesDefinition)? ')' ')'
propertiesDefinition ::=
'PROPERTIES' '(' key '=' value (',' key '=' value)* ')'
trafficAlgorithmTypeName ::=
string
loadBalancerTypeName ::=
string
key ::=
string
value ::=
literal
补充说明
TRAFFIC_ALGORITHM
支持SQL_MATCH
与SQL_HINT
两种类型LOAD_BALANCER
支持RANDOM
与ROUND_ROBIN
两种类型
示例
- 修改双路由规则
ALTER TRAFFIC RULE sql_match_traffic (
LABELS (OLTP),
TRAFFIC_ALGORITHM(TYPE(NAME="SQL_MATCH",PROPERTIES("sql" = "SELECT * FROM t_order WHERE order_id = 1; UPDATE t_order SET order_id = 5;"))),
LOAD_BALANCER(TYPE(NAME="RANDOM")));
保留字
ALTER
、TRAFFIC
、RULE
、LABELS
、TYPE
、NAME
、PROPERTIES
、TRAFFIC_ALGORITHM
、LOAD_BALANCER
相关链接
当前内容版权归 ShardingSphere 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 ShardingSphere .