Skip to content

Commit

Permalink
Add DataNodeDefinitionException (#30774)
Browse files Browse the repository at this point in the history
* Move UnsupportedActualDataNodeStructureException

* Move UnsupportedActualDataNodeStructureException

* Add DataNodeDefinitionException

* Move SingleDefinitionException

* Refactor AlgorithmDefinitionException
  • Loading branch information
terrymanu authored Apr 4, 2024
1 parent 32b5812 commit 7199fb2
Show file tree
Hide file tree
Showing 105 changed files with 202 additions and 169 deletions.
32 changes: 16 additions & 16 deletions docs/document/content/user-manual/error-code/sql-error-code.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,

| SQL State | Vendor Code | 错误信息 |
|-----------|-------------|-------------------------------------------------------------------------------------|
| HY000 | 10000 | Can not support 3-tier structure for actual data node '%s' with JDBC '%s'. |
| HY004 | 10001 | Invalid format for actual data node '%s'. |
| 42S02 | 10010 | Database is required. |
| 42S02 | 10011 | Schema '%s' does not exist. |
| 42S02 | 10012 | Table or view '%s' does not exist. |
| 42S02 | 10013 | Unknown column '%s' in '%s'. |
| 42S02 | 10000 | Database is required. |
| 42S02 | 10001 | Schema '%s' does not exist. |
| 42S02 | 10002 | Table or view '%s' does not exist. |
| 42S02 | 10003 | Unknown column '%s' in '%s'. |
| HY000 | 10100 | Can not %s storage units '%s'. |
| 42S02 | 10101 | There is no storage unit in database '%s'. |
| 44000 | 10102 | Storage units '%s' do not exist in database '%s'. |
Expand All @@ -33,16 +31,18 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
| 42S02 | 10202 | %s rules '%s' do not exist in database '%s'. |
| 44000 | 10203 | %s rules '%s' in database '%s' are still in used. |
| 42S01 | 10204 | Duplicate %s rule names '%s' in database '%s'. |
| 44000 | 10300 | Algorithm '%s.'%s' initialization failed, reason is: %s. |
| 44000 | 10301 | '%s' algorithm on %s is required. |
| 42S02 | 10302 | '%s' algorithm '%s' on %s is unregistered. |
| 44000 | 10303 | %s algorithms '%s' in database '%s' are still in used. |
| 44000 | 10304 | Invalid %s algorithm configuration '%s'. |
| HY000 | 10350 | Algorithm '%s.%s' execute failed, reason is: %s. |
| 44000 | 10400 | Invalid single rule configuration, reason is: %s. |
| 42S02 | 10401 | Single table '%s' does not exist. |
| HY000 | 10402 | Can not load table with database name '%s' and data source name '%s', reason is: %s |
| 0A000 | 10403 | Can not drop schema '%s' because of contains tables. |
| HY004 | 13000 | Invalid format for actual data node '%s'. |
| HY000 | 13001 | Can not support 3-tier structure for actual data node '%s' with JDBC '%s'. |
| 44000 | 10400 | Algorithm '%s.'%s' initialization failed, reason is: %s. |
| 44000 | 10401 | '%s' algorithm on %s is required. |
| 42S02 | 10402 | '%s' algorithm '%s' on %s is unregistered. |
| 44000 | 10403 | %s algorithms '%s' in database '%s' are still in used. |
| 44000 | 10404 | Invalid %s algorithm configuration '%s'. |
| HY000 | 10450 | Algorithm '%s.%s' execute failed, reason is: %s. |
| 44000 | 10500 | Invalid single rule configuration, reason is: %s. |
| 42S02 | 10501 | Single table '%s' does not exist. |
| HY000 | 10502 | Can not load table with database name '%s' and data source name '%s', reason is: %s |
| 0A000 | 10503 | Can not drop schema '%s' because of contains tables. |

### 数据

Expand Down
32 changes: 16 additions & 16 deletions docs/document/content/user-manual/error-code/sql-error-code.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi

| SQL State | Vendor Code | Reason |
|-----------|-------------|-------------------------------------------------------------------------------------|
| HY000 | 10000 | Can not support 3-tier structure for actual data node '%s' with JDBC '%s'. |
| HY004 | 10001 | Invalid format for actual data node '%s'. |
| 42S02 | 10010 | Database is required. |
| 42S02 | 10011 | Schema '%s' does not exist. |
| 42S02 | 10012 | Table or view '%s' does not exist. |
| 42S02 | 10013 | Unknown column '%s' in '%s'. |
| 42S02 | 10000 | Database is required. |
| 42S02 | 10001 | Schema '%s' does not exist. |
| 42S02 | 10002 | Table or view '%s' does not exist. |
| 42S02 | 10003 | Unknown column '%s' in '%s'. |
| HY000 | 10100 | Can not %s storage units '%s'. |
| 42S02 | 10101 | There is no storage unit in database '%s'. |
| 44000 | 10102 | Storage units '%s' do not exist in database '%s'. |
Expand All @@ -33,16 +31,18 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi
| 42S02 | 10202 | %s rules '%s' do not exist in database '%s'. |
| 44000 | 10203 | %s rules '%s' in database '%s' are still in used. |
| 42S01 | 10204 | Duplicate %s rule names '%s' in database '%s'. |
| 44000 | 10300 | Algorithm '%s.'%s' initialization failed, reason is: %s. |
| 44000 | 10301 | '%s' algorithm on %s is required. |
| 42S02 | 10302 | '%s' algorithm '%s' on %s is unregistered. |
| 44000 | 10303 | %s algorithms '%s' in database '%s' are still in used. |
| 44000 | 10304 | Invalid %s algorithm configuration '%s'. |
| HY000 | 10350 | Algorithm '%s.%s' execute failed, reason is: %s. |
| 44000 | 10400 | Invalid single rule configuration, reason is: %s. |
| 42S02 | 10401 | Single table '%s' does not exist. |
| HY000 | 10402 | Can not load table with database name '%s' and data source name '%s', reason is: %s |
| 0A000 | 10403 | Can not drop schema '%s' because of contains tables. |
| HY004 | 13000 | Invalid format for actual data node '%s'. |
| HY000 | 13001 | Can not support 3-tier structure for actual data node '%s' with JDBC '%s'. |
| 44000 | 10400 | Algorithm '%s.'%s' initialization failed, reason is: %s. |
| 44000 | 10401 | '%s' algorithm on %s is required. |
| 42S02 | 10402 | '%s' algorithm '%s' on %s is unregistered. |
| 44000 | 10403 | %s algorithms '%s' in database '%s' are still in used. |
| 44000 | 10404 | Invalid %s algorithm configuration '%s'. |
| HY000 | 10450 | Algorithm '%s.%s' execute failed, reason is: %s. |
| 44000 | 10500 | Invalid single rule configuration, reason is: %s. |
| 42S02 | 10501 | Single table '%s' does not exist. |
| HY000 | 10502 | Can not load table with database name '%s' and data source name '%s', reason is: %s |
| 0A000 | 10503 | Can not drop schema '%s' because of contains tables. |

### Data

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;

import javax.crypto.Cipher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import org.apache.shardingsphere.encrypt.exception.metadata.EncryptLikeQueryColumnNotFoundException;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.EmptyAlgorithmException;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.UnregisteredAlgorithmException;
import org.apache.shardingsphere.infra.algorithm.core.exception.EmptyAlgorithmException;
import org.apache.shardingsphere.infra.algorithm.core.exception.UnregisteredAlgorithmException;
import org.apache.shardingsphere.infra.config.rule.checker.RuleConfigurationChecker;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.infra.exception.core.external.sql.identifier.SQLExceptionIdentifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
import org.apache.shardingsphere.test.util.PropertiesBuilder;
import org.apache.shardingsphere.test.util.PropertiesBuilder.Property;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptColumnRuleConfiguration;
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
import org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.UnregisteredAlgorithmException;
import org.apache.shardingsphere.infra.algorithm.core.exception.UnregisteredAlgorithmException;
import org.apache.shardingsphere.infra.config.rule.checker.RuleConfigurationChecker;
import org.apache.shardingsphere.infra.spi.type.ordered.OrderedSPILoader;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.apache.shardingsphere.encrypt.distsql.statement.CreateEncryptRuleStatement;
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.infra.exception.metadata.rule.DuplicateRuleException;
import org.apache.shardingsphere.infra.exception.metadata.rule.InvalidRuleConfigurationException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.apache.shardingsphere.encrypt.distsql.segment.EncryptRuleSegment;
import org.apache.shardingsphere.encrypt.distsql.statement.CreateEncryptRuleStatement;
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.spi.exception.ServiceProviderNotFoundException;
import org.apache.shardingsphere.test.util.PropertiesBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.mask.spi.MaskAlgorithm;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.shardingsphere.mask.algorithm.cover;

import com.google.common.base.Strings;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.mask.algorithm.MaskAlgorithmPropertiesChecker;
import org.apache.shardingsphere.mask.spi.MaskAlgorithm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.shardingsphere.mask.algorithm.cover;

import com.google.common.base.Strings;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.mask.algorithm.MaskAlgorithmPropertiesChecker;
import org.apache.shardingsphere.mask.spi.MaskAlgorithm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.mask.spi.MaskAlgorithm;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.shardingsphere.mask.checker;

import org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.UnregisteredAlgorithmException;
import org.apache.shardingsphere.infra.algorithm.core.exception.UnregisteredAlgorithmException;
import org.apache.shardingsphere.infra.config.rule.checker.RuleConfigurationChecker;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.infra.exception.core.external.sql.identifier.SQLExceptionIdentifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.shardingsphere.mask.algorithm;

import org.apache.shardingsphere.infra.algorithm.core.exception.type.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.mask.spi.MaskAlgorithm;
import org.apache.shardingsphere.test.util.PropertiesBuilder;
import org.apache.shardingsphere.test.util.PropertiesBuilder.Property;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
import org.apache.shardingsphere.mask.spi.MaskAlgorithm;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.shardingsphere.readwritesplitting.checker;

import com.google.common.base.Strings;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.UnregisteredAlgorithmException;
import org.apache.shardingsphere.infra.algorithm.core.exception.UnregisteredAlgorithmException;
import org.apache.shardingsphere.infra.algorithm.loadbalancer.core.LoadBalanceAlgorithm;
import org.apache.shardingsphere.infra.config.rule.checker.RuleConfigurationChecker;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.shardingsphere.readwritesplitting.checker;

import org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.config.rule.checker.RuleConfigurationChecker;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.attribute.RuleAttributes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.shardingsphere.shadow.algorithm.shadow.column;

import lombok.Getter;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.shadow.algorithm.shadow.validator.ShadowValueValidator;
import org.apache.shardingsphere.shadow.api.shadow.ShadowOperationType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.shardingsphere.shadow.algorithm.shadow.column;

import org.apache.shardingsphere.infra.algorithm.core.exception.type.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;

import java.util.Properties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.shardingsphere.shadow.algorithm.shadow.column;

import org.apache.shardingsphere.infra.algorithm.core.exception.type.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;

import java.util.Properties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.shardingsphere.shadow.checker;

import org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.EmptyAlgorithmException;
import org.apache.shardingsphere.infra.algorithm.core.exception.EmptyAlgorithmException;
import org.apache.shardingsphere.infra.config.rule.checker.RuleConfigurationChecker;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.infra.exception.core.external.sql.identifier.SQLExceptionIdentifier;
Expand Down
Loading

0 comments on commit 7199fb2

Please sign in to comment.