RAL (Resource & Rule Administration Language) responsible for the added-on feature of hint, transaction type switch, scaling, sharding execute planning and so on.
Hint
Statement
Function
Example
SET READWRITE_SPLITTING HINT SOURCE = [auto / write]
For current connection, set readwrite splitting routing strategy (automatic or forced to write data source)
SET READWRITE_SPLITTINGHINT SOURCE = write
SET SHARDING HINT DATABASE_VALUE = yy
For current connection, set sharding value for database sharding only, yy: sharding value
SET SHARDING HINT DATABASE_VALUE = 100
ADD SHARDING HINT DATABASE_VALUE xx = yy
For current connection, add sharding value for table, xx: logic table, yy: database sharding value
ADD SHARDING HINT DATABASE_VALUE t_order = 100
ADD SHARDING HINT TABLE_VALUE xx = yy
For current connection, add sharding value for table, xx: logic table, yy: table sharding value
ADD SHARDING HINT TABLE_VALUE t_order = 100
CLEAR HINT SETTINGS
For current connection, clear all hint settings
CLEAR HINT
CLEAR [SHARDING HINT / READWRITE_SPLITTING HINT]
For current connection, clear hint settings of sharding or readwrite splitting
CLEAR READWRITE_SPLITTING HINT
SHOW [SHARDING / READWRITE_SPLITTING] HINT STATUS
For current connection, query hint settings of sharding or readwrite splitting
SHOW READWRITE_SPLITTING HINT STATUS
Scaling
Statement
Function
Example
SHOW SCALING LIST
Query running list
SHOW SCALING LIST
SHOW SCALING STATUS jobId
Query scaling status, xx: jobId
SHOW SCALING STATUS 1234
START SCALING jobId
Start scaling, xx: jobId
START SCALING 1234
STOP SCALING jobId
Stop scaling, xx: jobId
STOP SCALING 1234
DROP SCALING jobId
Drop scaling, xx: jobId
DROP SCALING 1234
RESET SCALING jobId
reset progress, xx: jobId
RESET SCALING 1234
CHECK SCALING jobId
Data consistency check with algorithm in server.yaml, xx: jobId
CHECK SCALING 1234
SHOW SCALING CHECK ALGORITHMS
Show available consistency check algorithms
SHOW SCALING CHECK ALGORITHMS
CHECK SCALING {jobId} by type(name={algorithmType})
Data consistency check with defined algorithm
CHECK SCALING 1234 by type(name=DEFAULT)
STOP SCALING SOURCE WRITING jobId
The source ShardingSphere data source is discontinued, xx: jobId
STOP SCALING SOURCE WRITING 1234
RESTORE SCALING SOURCE WRITING jobId
Restore source data source writing, xx: jobId
RESTORE SCALING SOURCE WRITING 1234
APPLY SCALING jobId
Switch to target ShardingSphere metadata, xx: jobId
SHOW READWRITE_SPLITTING (READ)? resourceName [FROM databaseName]
Query all read resources status
SHOW READWRITE_SPLITTING READ RESOURCES
Global Rule
Statement
Function
Example
SHOW AUTHORITY RULE
Query authority rule configuration
SHOW AUTHORITY RULE
SHOW TRANSACTION RULE
Query transaction rule configuration
SHOW TRANSACTION RULE
SHOW SQL_PARSER RULE
Query SQL parser rule configuration
SHOW SQL_PARSER RULE
ALTER TRANSACTION RULE(DEFAULT=xx,TYPE(NAME=xxx, PROPERTIES(“key1"="value1”,“key2"="value2”…)))
Alter transaction rule configuration, DEFAULT: default transaction type, support LOCAL, XA, BASE; NAME: name of transaction manager, support Atomikos, Narayana and Bitronix
ALTER TRANSACTION RULE(DEFAULT=XA,TYPE(NAME=Narayana, PROPERTIES(“databaseName"="jbossts”,“host"="127.0.0.1”)))
ALTER SQL_PARSER RULE SQL_COMMENT_PARSE_ENABLE=xx, PARSE_TREE_CACHE(INITIAL_CAPACITY=xx, MAXIMUM_SIZE=xx, CONCURRENCY_LEVEL=xx), SQL_STATEMENT_CACHE(INITIAL_CAPACITY=xxx, MAXIMUM_SIZE=xxx, CONCURRENCY_LEVEL=xxx)
Alter SQL parser rule configuration, SQL_COMMENT_PARSE_ENABLE: whether to parse the SQL comment, PARSE_TREE_CACHE: local cache configuration of syntax tree, SQL_STATEMENT_CACHE: local cache of SQL statement
ALTER SQL_PARSER RULE SQL_COMMENT_PARSE_ENABLE=false, PARSE_TREE_CACHE(INITIAL_CAPACITY=10, MAXIMUM_SIZE=11, CONCURRENCY_LEVEL=1), SQL_STATEMENT_CACHE(INITIAL_CAPACITY=11, MAXIMUM_SIZE=11, CONCURRENCY_LEVEL=100)