Skip to content

Commit

Permalink
Move ResourceDefinitionException and RuleDefinitionException (#30719)
Browse files Browse the repository at this point in the history
* Refactor TableDoesNotExistException

* Refactor TableNotFoundException

* Refactor UnsupportedStorageTypeException

* Refactor UnsupportedStorageTypeException

* Refactor UnrecognizedDatabaseURLException

* Refactor UnsupportedStorageTypeException

* Refactor UnsupportedStorageTypeException

* Move ResourceDefinitionException and RuleDefinitionException
  • Loading branch information
terrymanu authored Mar 31, 2024
1 parent 152da00 commit 211fc57
Show file tree
Hide file tree
Showing 58 changed files with 84 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,16 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,

| SQL State | Vendor Code | 错误信息 |
|-----------|-------------|--------------------------------------------------------------------------------|
| 08000 | 10001 | The URL \`%s\` is not recognized, please refer to the pattern \`%s\`. |
| 42000 | 10002 | Can not support 3-tier structure for actual data node \`%s\` with JDBC \`%s\`. |
| 0A000 | 10002 | Can not support 3-tier structure for actual data node \`%s\` with JDBC \`%s\`. |
| HY004 | 10003 | Invalid format for actual data node \`%s\`. |
| HY000 | 10005 | Column '%s' in %s is ambiguous. |
| 42S02 | 10006 | Unknown column '%s' in '%s'. |
| 42S02 | 10007 | Table or view \`%s\` does not exist. |
| 42S02 | 10008 | Missing required table '%s' in storage unit '%s'. |
| 42000 | 10010 | Rule does not exist. |
| 42S02 | 10020 | Schema \`%s\` does not exist. |
| 42S02 | 10021 | Single table \`%s\` does not exist. |
| HY000 | 10022 | Can not load table with database name \`%s\` and data source name \`%s\`. |
| 0A000 | 10030 | Can not drop schema \`%s\` because of contains tables. |
| 0A000 | 10040 | Unsupported storage type of \`%s.%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 Down Expand Up @@ -74,6 +71,8 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
|-----------|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 08000 | 13000 | Can not register driver, reason is: %s |
| 08000 | 13001 | Can not register SQL federation driver, reason is: %s |
| 08000 | 13002 | The URL '%s' is not recognized, please refer to the pattern '%s'. |
| 0A000 | 13003 | Unsupported storage type of URL '%s'. |
| 01000 | 13010 | Circuit break open, the request has been ignored. |
| 01000 | 13011 | The cluster status is read-only. |
| 01000 | 13012 | The cluster status is unavailable. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,16 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi

| SQL State | Vendor Code | Reason |
|-----------|-------------|--------------------------------------------------------------------------------|
| 08000 | 10001 | The URL \`%s\` is not recognized, please refer to the pattern \`%s\`. |
| 42000 | 10002 | Can not support 3-tier structure for actual data node \`%s\` with JDBC \`%s\`. |
| 0A000 | 10002 | Can not support 3-tier structure for actual data node \`%s\` with JDBC \`%s\`. |
| HY004 | 10003 | Invalid format for actual data node \`%s\`. |
| HY000 | 10005 | Column '%s' in %s is ambiguous. |
| 42S02 | 10006 | Unknown column '%s' in '%s'. |
| 42S02 | 10007 | Table or view \`%s\` does not exist. |
| 42S02 | 10008 | Missing required table '%s' in storage unit '%s'. |
| 42000 | 10010 | Rule does not exist. |
| 42S02 | 10020 | Schema \`%s\` does not exist. |
| 42S02 | 10021 | Single table \`%s\` does not exist. |
| HY000 | 10022 | Can not load table with database name \`%s\` and data source name \`%s\`. |
| 0A000 | 10030 | Can not drop schema \`%s\` because of contains tables. |
| 0A000 | 10040 | Unsupported storage type of \`%s.%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 @@ -36,12 +33,10 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi
| 0A000 | 10111 | Can not alter connection info in storage units: '%s'. |
| 44000 | 10120 | Invalid storage unit status, error message is: %s. |
| 44000 | 10200 | Invalid '%s' rule '%s', error message is: %s |
| 44000 | 10200 | Invalid '%s' rule '%s', error message is: %s |
| 42S02 | 10201 | There is no rule in database '%s'. |
| 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 | 10210 | There is no rule 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. |
Expand Down Expand Up @@ -76,6 +71,8 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi
|-----------|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 08000 | 13000 | Can not register driver, reason is: %s |
| 08000 | 13001 | Can not register SQL federation driver, reason is: %s |
| 08000 | 13002 | The URL '%s' is not recognized, please refer to the pattern '%s'. |
| 0A000 | 13003 | Unsupported storage type of URL '%s'. |
| 01000 | 13010 | Circuit break open, the request has been ignored. |
| 01000 | 13011 | The cluster status is read-only. |
| 01000 | 13012 | The cluster status is unavailable. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.shardingsphere.broadcast.distsql.statement.CreateBroadcastTableRuleStatement;
import org.apache.shardingsphere.broadcast.rule.BroadcastRule;
import org.apache.shardingsphere.infra.exception.rule.DuplicateRuleException;
import org.apache.shardingsphere.infra.exception.storageunit.EmptyStorageUnitException;
import org.apache.shardingsphere.infra.exception.resource.storageunit.EmptyStorageUnitException;
import org.apache.shardingsphere.distsql.handler.engine.update.rdl.rule.spi.database.DatabaseRuleCreateExecutor;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.shardingsphere.broadcast.distsql.statement.CreateBroadcastTableRuleStatement;
import org.apache.shardingsphere.broadcast.rule.BroadcastRule;
import org.apache.shardingsphere.infra.exception.rule.DuplicateRuleException;
import org.apache.shardingsphere.infra.exception.storageunit.EmptyStorageUnitException;
import org.apache.shardingsphere.infra.exception.resource.storageunit.EmptyStorageUnitException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.resource.unit.StorageUnit;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.infra.exception.rule.DuplicateRuleException;
import org.apache.shardingsphere.infra.exception.rule.InvalidRuleConfigurationException;
import org.apache.shardingsphere.infra.exception.storageunit.EmptyStorageUnitException;
import org.apache.shardingsphere.infra.exception.resource.storageunit.EmptyStorageUnitException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.shardingsphere.infra.exception.rule.DuplicateRuleException;
import org.apache.shardingsphere.infra.exception.rule.InvalidRuleConfigurationException;
import org.apache.shardingsphere.infra.exception.rule.MissingRequiredRuleException;
import org.apache.shardingsphere.infra.exception.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.infra.exception.resource.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.infra.algorithm.loadbalancer.core.LoadBalanceAlgorithm;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.apache.shardingsphere.infra.state.datasource.DataSourceState;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.mode.storage.service.StorageNodeStatusService;
import org.apache.shardingsphere.infra.exception.storageunit.InvalidStorageUnitStatusException;
import org.apache.shardingsphere.infra.exception.resource.storageunit.InvalidStorageUnitStatusException;
import org.apache.shardingsphere.readwritesplitting.exception.checker.MissingRequiredReadStorageUnitException;
import org.apache.shardingsphere.readwritesplitting.distsql.statement.AlterReadwriteSplittingStorageUnitStatusStatement;
import org.apache.shardingsphere.readwritesplitting.rule.ReadwriteSplittingDataSourceRule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import org.apache.shardingsphere.infra.exception.rule.InvalidRuleConfigurationException;
import org.apache.shardingsphere.infra.exception.rule.MissingRequiredRuleException;
import org.apache.shardingsphere.infra.exception.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.infra.exception.resource.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.distsql.segment.AlgorithmSegment;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.resource.ResourceMetaData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import org.apache.shardingsphere.infra.exception.rule.DuplicateRuleException;
import org.apache.shardingsphere.infra.exception.rule.InvalidRuleConfigurationException;
import org.apache.shardingsphere.infra.exception.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.infra.exception.resource.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.distsql.segment.AlgorithmSegment;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.resource.ResourceMetaData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
import org.apache.shardingsphere.infra.datanode.DataNode;
import org.apache.shardingsphere.infra.exception.core.external.sql.type.kernel.category.RuleDefinitionException;
import org.apache.shardingsphere.infra.exception.rule.RuleDefinitionException;
import org.apache.shardingsphere.infra.exception.rule.MissingRequiredRuleException;
import org.apache.shardingsphere.infra.exception.rule.InUsedRuleException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.infra.exception.core.external.sql.type.kernel.KernelSQLException;
import org.apache.shardingsphere.infra.exception.rule.InvalidRuleConfigurationException;
import org.apache.shardingsphere.infra.exception.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.infra.exception.resource.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.rule.attribute.datasource.DataSourceMapperRuleAttribute;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.apache.shardingsphere.infra.algorithm.core.exception.type.InUsedAlgorithmException;
import org.apache.shardingsphere.infra.exception.rule.DuplicateRuleException;
import org.apache.shardingsphere.infra.exception.rule.MissingRequiredRuleException;
import org.apache.shardingsphere.infra.exception.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.infra.exception.resource.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.distsql.segment.AlgorithmSegment;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.resource.ResourceMetaData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import org.apache.shardingsphere.infra.exception.rule.DuplicateRuleException;
import org.apache.shardingsphere.infra.exception.rule.InvalidRuleConfigurationException;
import org.apache.shardingsphere.infra.exception.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.infra.exception.resource.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.distsql.segment.AlgorithmSegment;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.resource.ResourceMetaData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.apache.shardingsphere.infra.exception.rule.DuplicateRuleException;
import org.apache.shardingsphere.infra.exception.rule.InvalidRuleConfigurationException;
import org.apache.shardingsphere.infra.exception.rule.MissingRequiredRuleException;
import org.apache.shardingsphere.infra.exception.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.infra.exception.resource.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.infra.expr.core.InlineExpressionParserFactory;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.rule.attribute.datasource.DataSourceMapperRuleAttribute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.apache.shardingsphere.infra.exception.core.external.sql.type.generic.UnsupportedSQLOperationException;
import org.apache.shardingsphere.infra.exception.rule.DuplicateRuleException;
import org.apache.shardingsphere.infra.exception.rule.MissingRequiredRuleException;
import org.apache.shardingsphere.infra.exception.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.infra.exception.resource.storageunit.MissingRequiredStorageUnitsException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.resource.ResourceMetaData;
import org.apache.shardingsphere.infra.metadata.database.rule.RuleMetaData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.InUsedAlgorithmException;
import org.apache.shardingsphere.infra.algorithm.core.exception.type.UnregisteredAlgorithmException;
import org.apache.shardingsphere.infra.exception.core.external.sql.type.kernel.category.RuleDefinitionException;
import org.apache.shardingsphere.infra.exception.rule.RuleDefinitionException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.shardingsphere.sharding.distsql.update;

import com.google.common.base.Splitter;
import org.apache.shardingsphere.infra.exception.core.external.sql.type.kernel.category.RuleDefinitionException;
import org.apache.shardingsphere.infra.exception.rule.RuleDefinitionException;
import org.apache.shardingsphere.infra.exception.rule.MissingRequiredRuleException;
import org.apache.shardingsphere.infra.exception.rule.InUsedRuleException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
Expand Down
Loading

0 comments on commit 211fc57

Please sign in to comment.