lanchengx opened a new issue #15414:
URL: https://github.com/apache/shardingsphere/issues/15414


   Hi community,
   
   this issue is to refactor RAL's executors;
   
   **current structure**
   
   There are two types of RAL syntax, `advance` and `common`.
   `common` is further divided into `set`, `show`, `hint`, `alter`, `drop` and 
`create` types. Among them, `set`, `show`, `hint` have their own subclasses. 
details as follows:
   ```shell
   ├── ral
   │    ├── common
   │    │      ├── alter
   │    │      │     ├── executor
   │    │      │     │      ├── AlterSQLParserRuleExecutor.java
   │    │      │     │      ├── AlterTrafficRuleExecutor.java
   │    │      │     │      ├── AlterTransactionRuleExecutor.java
   │    │      │     ├── AlterStatementExecutorFactory.java
   │    │      │     ├── AlterStatementExecutor.java
   │    │      ├── create
   │    │      ├── hint
   │    │      ├── set
   │    │      ├── show
   │    │      ├── drop
   │    │      ├── AlterDistSQLBackendHandler.java
   │    │      ├── CommonDistSQLBackendHandlerFactory.java
   │    │      ├── HintDistSQLBackendHandler.java
   │    │      ├── RefreshTableMetadataHandler.java
   │    │      ├── SetDistSQLBackendHandler.java
   │    │      ├── ShowDistSQLBackendHandler.java
   │    ├── advance
   │    │      ├── PreviewDistSQLBackendHandler.java
   │    │      ├── ParseDistSQLBackendHandler.java
   │    │      ├── ......
   │    ├── RALBackendHandlerFactory.java
   ```
   
   Under this structure, there are the following two problems
   
   - The categories in `common` overlap
   - The code level is too deep
   
   In addition, coding in the executor of the RAL query syntax is more complex 
than in RQL, so it also needs to be optimized.
   
   
   **optimized structure**
   
   The RAL syntax is divided into two types: `advance` and `common` by the 
package name, and the actual code implements the two categories of `updatable` 
and `queryable`, details as follows:
   
   ```shell
   ├── ral
   │    ├── common
   │    │      ├── AlterTrafficRuleHandler.java
   │    │      ├── SetInstanceStatusHandler.java
   │    │      ├── ShowAuthorityRuleHandler.java
   │    │      ├── ......
   │    ├── advance
   │    │      ├── PreviewDistSQLBackendHandler.java
   │    │      ├── ParseDistSQLBackendHandler.java
   │    │      ├── ......
   │    ├── UpdatableRALBackendHandler.java
   │    ├── QueryableRALBackendHandler.java
   │    ├── RALBackendHandler.java
   │    ├── RALBackendHandlerFactory.java
   
   
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to