未验证 提交 39b5412e 编写于 作者: L Liang Zhang 提交者: GitHub

Unify feature loading order (#5800)

* refactor ExecutionContext

* add ShardingOrder

* add ShardingOrder

* Unify feature loading order
上级 60b289b5
......@@ -15,26 +15,19 @@
* limitations under the License.
*/
package org.apache.shardingsphere.replica.execute.executor;
package org.apache.shardingsphere.encrypt.constant;
import org.apache.shardingsphere.infra.executor.sql.resourced.jdbc.executor.SQLExecutorCallback;
import org.apache.shardingsphere.infra.spi.order.OrderedSPI;
import org.apache.shardingsphere.replica.rule.ReplicaRule;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
/**
* SQL executor callback for replica.
*
* @param <T> class type of return value
* Encrypt order.
*/
public abstract class ReplicaSQLExecutorCallback<T> implements SQLExecutorCallback<T>, OrderedSPI<ReplicaRule> {
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class EncryptOrder {
@Override
public final int getOrder() {
return 5;
}
@Override
public final Class<ReplicaRule> getTypeClass() {
return ReplicaRule.class;
}
/**
* Encrypt order.
*/
public static final int ORDER = 50;
}
......@@ -17,6 +17,7 @@
package org.apache.shardingsphere.encrypt.metadata;
import org.apache.shardingsphere.encrypt.constant.EncryptOrder;
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
import org.apache.shardingsphere.sql.parser.binder.metadata.column.ColumnMetaData;
import org.apache.shardingsphere.sql.parser.binder.metadata.table.TableMetaData;
......@@ -60,7 +61,7 @@ public final class EncryptMetaDataDecorator implements RuleMetaDataDecorator<Enc
@Override
public int getOrder() {
return 5;
return EncryptOrder.ORDER;
}
@Override
......
......@@ -17,14 +17,15 @@
package org.apache.shardingsphere.encrypt.metadata;
import org.apache.shardingsphere.encrypt.constant.EncryptOrder;
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
import org.apache.shardingsphere.sql.parser.binder.metadata.schema.SchemaMetaData;
import org.apache.shardingsphere.sql.parser.binder.metadata.table.TableMetaData;
import org.apache.shardingsphere.sql.parser.binder.metadata.table.TableMetaDataLoader;
import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.infra.metadata.schema.spi.RuleMetaDataLoader;
import org.apache.shardingsphere.infra.datanode.DataNodes;
import org.apache.shardingsphere.infra.metadata.schema.spi.RuleMetaDataLoader;
import org.apache.shardingsphere.sql.parser.binder.metadata.schema.SchemaMetaData;
import org.apache.shardingsphere.sql.parser.binder.metadata.table.TableMetaData;
import org.apache.shardingsphere.sql.parser.binder.metadata.table.TableMetaDataLoader;
import javax.sql.DataSource;
import java.sql.SQLException;
......@@ -61,7 +62,7 @@ public final class EncryptMetaDataLoader implements RuleMetaDataLoader<EncryptRu
@Override
public int getOrder() {
return 10;
return EncryptOrder.ORDER;
}
@Override
......
......@@ -18,6 +18,7 @@
package org.apache.shardingsphere.encrypt.rule;
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
import org.apache.shardingsphere.encrypt.constant.EncryptOrder;
import org.apache.shardingsphere.infra.rule.ShardingSphereRuleBuilder;
import java.util.Collection;
......@@ -34,7 +35,7 @@ public final class EncryptRuleBuilder implements ShardingSphereRuleBuilder<Encry
@Override
public int getOrder() {
return 10;
return EncryptOrder.ORDER;
}
@Override
......
......@@ -19,6 +19,7 @@ package org.apache.shardingsphere.encrypt.yaml.swapper;
import com.google.common.collect.Maps;
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
import org.apache.shardingsphere.encrypt.constant.EncryptOrder;
import org.apache.shardingsphere.encrypt.yaml.config.YamlEncryptRuleConfiguration;
import org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapper;
......@@ -57,6 +58,6 @@ public final class EncryptRuleConfigurationYamlSwapper implements YamlRuleConfig
@Override
public int getOrder() {
return 20;
return EncryptOrder.ORDER;
}
}
......@@ -17,20 +17,21 @@
package org.apache.shardingsphere.encrypt.merge;
import org.apache.shardingsphere.encrypt.constant.EncryptOrder;
import org.apache.shardingsphere.encrypt.merge.dal.EncryptDALResultDecorator;
import org.apache.shardingsphere.encrypt.merge.dql.EncryptDQLResultDecorator;
import org.apache.shardingsphere.encrypt.merge.dql.EncryptorMetaData;
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.sql.parser.binder.metadata.schema.SchemaMetaData;
import org.apache.shardingsphere.sql.parser.binder.statement.SQLStatementContext;
import org.apache.shardingsphere.sql.parser.binder.statement.dml.SelectStatementContext;
import org.apache.shardingsphere.sql.parser.sql.statement.dal.DALStatement;
import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
import org.apache.shardingsphere.infra.config.properties.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.infra.merge.engine.decorator.ResultDecorator;
import org.apache.shardingsphere.infra.merge.engine.decorator.ResultDecoratorEngine;
import org.apache.shardingsphere.infra.merge.engine.decorator.impl.TransparentResultDecorator;
import org.apache.shardingsphere.sql.parser.binder.metadata.schema.SchemaMetaData;
import org.apache.shardingsphere.sql.parser.binder.statement.SQLStatementContext;
import org.apache.shardingsphere.sql.parser.binder.statement.dml.SelectStatementContext;
import org.apache.shardingsphere.sql.parser.sql.statement.dal.DALStatement;
/**
* Result decorator engine for encrypt.
......@@ -52,7 +53,7 @@ public final class EncryptResultDecoratorEngine implements ResultDecoratorEngine
@Override
public int getOrder() {
return 20;
return EncryptOrder.ORDER;
}
@Override
......
......@@ -17,6 +17,7 @@
package org.apache.shardingsphere.encrypt.rewrite.context;
import org.apache.shardingsphere.encrypt.constant.EncryptOrder;
import org.apache.shardingsphere.encrypt.rewrite.parameter.EncryptParameterRewriterBuilder;
import org.apache.shardingsphere.encrypt.rewrite.token.EncryptTokenGenerateBuilder;
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
......@@ -46,7 +47,7 @@ public final class EncryptSQLRewriteContextDecorator implements SQLRewriteContex
@Override
public int getOrder() {
return 20;
return EncryptOrder.ORDER;
}
@Override
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.shardingsphere.masterslave.constant;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
/**
* Master-slave order.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class MasterSlaveOrder {
/**
* Master-slave order.
*/
public static final int ORDER = 10;
}
......@@ -19,6 +19,7 @@ package org.apache.shardingsphere.masterslave.rule;
import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
import org.apache.shardingsphere.infra.rule.ShardingSphereRuleBuilder;
import org.apache.shardingsphere.masterslave.constant.MasterSlaveOrder;
import java.util.Collection;
......@@ -34,7 +35,7 @@ public final class MasterSlaveRuleBuilder implements ShardingSphereRuleBuilder<M
@Override
public int getOrder() {
return 5;
return MasterSlaveOrder.ORDER;
}
@Override
......
......@@ -21,6 +21,7 @@ import com.google.common.base.Strings;
import org.apache.shardingsphere.masterslave.api.config.LoadBalanceStrategyConfiguration;
import org.apache.shardingsphere.masterslave.api.config.MasterSlaveDataSourceConfiguration;
import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
import org.apache.shardingsphere.masterslave.constant.MasterSlaveOrder;
import org.apache.shardingsphere.masterslave.yaml.config.YamlMasterSlaveDataSourceConfiguration;
import org.apache.shardingsphere.masterslave.yaml.config.YamlMasterSlaveRuleConfiguration;
import org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapper;
......@@ -83,6 +84,6 @@ public final class MasterSlaveRuleConfigurationYamlSwapper implements YamlRuleCo
@Override
public int getOrder() {
return 10;
return MasterSlaveOrder.ORDER;
}
}
......@@ -25,6 +25,7 @@ import org.apache.shardingsphere.infra.route.context.RouteMapper;
import org.apache.shardingsphere.infra.route.context.RouteResult;
import org.apache.shardingsphere.infra.route.context.RouteUnit;
import org.apache.shardingsphere.infra.route.decorator.RouteDecorator;
import org.apache.shardingsphere.masterslave.constant.MasterSlaveOrder;
import org.apache.shardingsphere.masterslave.route.engine.impl.MasterSlaveDataSourceRouter;
import org.apache.shardingsphere.masterslave.rule.MasterSlaveDataSourceRule;
import org.apache.shardingsphere.masterslave.rule.MasterSlaveRule;
......@@ -65,7 +66,7 @@ public final class MasterSlaveRouteDecorator implements RouteDecorator<MasterSla
@Override
public int getOrder() {
return 10;
return MasterSlaveOrder.ORDER;
}
@Override
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.shardingsphere.replica.constant;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
/**
* Replica order.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class ReplicaOrder {
/**
* Replica order.
*/
public static final int ORDER = 20;
}
......@@ -19,6 +19,7 @@ package org.apache.shardingsphere.replica.rule;
import org.apache.shardingsphere.infra.rule.ShardingSphereRuleBuilder;
import org.apache.shardingsphere.replica.api.config.ReplicaRuleConfiguration;
import org.apache.shardingsphere.replica.constant.ReplicaOrder;
import java.util.Collection;
......@@ -34,7 +35,7 @@ public final class ReplicaRuleBuilder implements ShardingSphereRuleBuilder<Repli
@Override
public int getOrder() {
return 7;
return ReplicaOrder.ORDER;
}
@Override
......
......@@ -20,6 +20,7 @@ package org.apache.shardingsphere.replica.yaml.swapper;
import org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapper;
import org.apache.shardingsphere.replica.api.config.ReplicaDataSourceConfiguration;
import org.apache.shardingsphere.replica.api.config.ReplicaRuleConfiguration;
import org.apache.shardingsphere.replica.constant.ReplicaOrder;
import org.apache.shardingsphere.replica.yaml.config.YamlReplicaDataSourceConfiguration;
import org.apache.shardingsphere.replica.yaml.config.YamlReplicaRuleConfiguration;
......@@ -73,6 +74,6 @@ public final class ReplicaRuleConfigurationYamlSwapper implements YamlRuleConfig
@Override
public int getOrder() {
return 12;
return ReplicaOrder.ORDER;
}
}
......@@ -20,6 +20,7 @@ package org.apache.shardingsphere.replica.execute.group;
import org.apache.shardingsphere.infra.executor.kernel.InputGroup;
import org.apache.shardingsphere.infra.executor.sql.resourced.ResourceManagedExecuteUnit;
import org.apache.shardingsphere.infra.executor.sql.group.ExecuteGroupDecorator;
import org.apache.shardingsphere.replica.constant.ReplicaOrder;
import org.apache.shardingsphere.replica.rule.ReplicaRule;
import java.util.Collection;
......@@ -52,7 +53,7 @@ public final class ReplicaExecuteGroupDecorator<T extends ResourceManagedExecute
@Override
public int getOrder() {
return 5;
return ReplicaOrder.ORDER;
}
@Override
......
......@@ -25,6 +25,7 @@ import org.apache.shardingsphere.infra.route.context.RouteMapper;
import org.apache.shardingsphere.infra.route.context.RouteResult;
import org.apache.shardingsphere.infra.route.context.RouteUnit;
import org.apache.shardingsphere.infra.route.decorator.RouteDecorator;
import org.apache.shardingsphere.replica.constant.ReplicaOrder;
import org.apache.shardingsphere.replica.rule.ReplicaRule;
import java.util.Collection;
......@@ -66,7 +67,7 @@ public final class ReplicaRouteDecorator implements RouteDecorator<ReplicaRule>
@Override
public int getOrder() {
return 12;
return ReplicaOrder.ORDER;
}
@Override
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.shardingsphere.shadow.constant;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
/**
* Shadow order.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class ShadowOrder {
/**
* Shadow order.
*/
public static final int ORDER = -50;
}
......@@ -17,8 +17,9 @@
package org.apache.shardingsphere.shadow.rule;
import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
import org.apache.shardingsphere.infra.rule.ShardingSphereRuleBuilder;
import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
import org.apache.shardingsphere.shadow.constant.ShadowOrder;
import java.util.Collection;
......@@ -34,7 +35,7 @@ public final class ShadowRuleBuilder implements ShardingSphereRuleBuilder<Shadow
@Override
public int getOrder() {
return 20;
return ShadowOrder.ORDER;
}
@Override
......
......@@ -17,9 +17,10 @@
package org.apache.shardingsphere.shadow.yaml.swapper;
import org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapper;
import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
import org.apache.shardingsphere.shadow.constant.ShadowOrder;
import org.apache.shardingsphere.shadow.yaml.config.YamlShadowRuleConfiguration;
import org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapper;
/**
* Shadow rule configuration yaml swapper.
......@@ -51,6 +52,6 @@ public final class ShadowRuleConfigurationYamlSwapper implements YamlRuleConfigu
@Override
public int getOrder() {
return -5;
return ShadowOrder.ORDER;
}
}
......@@ -17,14 +17,15 @@
package org.apache.shardingsphere.shadow.rewrite.context;
import org.apache.shardingsphere.shadow.rule.ShadowRule;
import org.apache.shardingsphere.shadow.rewrite.parameter.ShadowParameterRewriterBuilder;
import org.apache.shardingsphere.shadow.rewrite.token.ShadowTokenGenerateBuilder;
import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
import org.apache.shardingsphere.infra.rewrite.context.SQLRewriteContext;
import org.apache.shardingsphere.infra.rewrite.context.SQLRewriteContextDecorator;
import org.apache.shardingsphere.infra.rewrite.parameter.rewriter.ParameterRewriter;
import org.apache.shardingsphere.infra.route.context.RouteContext;
import org.apache.shardingsphere.shadow.constant.ShadowOrder;
import org.apache.shardingsphere.shadow.rewrite.parameter.ShadowParameterRewriterBuilder;
import org.apache.shardingsphere.shadow.rewrite.token.ShadowTokenGenerateBuilder;
import org.apache.shardingsphere.shadow.rule.ShadowRule;
/**
* SQL rewrite context decorator for shadow.
......@@ -44,7 +45,7 @@ public final class ShadowSQLRewriteContextDecorator implements SQLRewriteContext
@Override
public int getOrder() {
return 30;
return ShadowOrder.ORDER;
}
@Override
......
......@@ -17,6 +17,7 @@
package org.apache.shardingsphere.shadow.route.engine;
import org.apache.shardingsphere.shadow.constant.ShadowOrder;
import org.apache.shardingsphere.shadow.rule.ShadowRule;
import org.apache.shardingsphere.shadow.route.engine.impl.PreparedShadowDataSourceRouter;
import org.apache.shardingsphere.shadow.route.engine.impl.SimpleShadowDataSourceRouter;
......@@ -100,7 +101,7 @@ public final class ShadowRouteDecorator implements RouteDecorator<ShadowRule> {
@Override
public int getOrder() {
return 20;
return ShadowOrder.ORDER;
}
@Override
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.shardingsphere.sharding.constant;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
/**
* Sharding order.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class ShardingOrder {
/**
* Sharding order.
*/
public static final int ORDER = 0;
}
......@@ -17,13 +17,14 @@
package org.apache.shardingsphere.sharding.metadata;
import org.apache.shardingsphere.infra.datanode.DataNode;
import org.apache.shardingsphere.infra.metadata.schema.spi.RuleMetaDataDecorator;
import org.apache.shardingsphere.sharding.constant.ShardingOrder;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.apache.shardingsphere.sharding.rule.TableRule;
import org.apache.shardingsphere.sql.parser.binder.metadata.column.ColumnMetaData;
import org.apache.shardingsphere.sql.parser.binder.metadata.index.IndexMetaData;
import org.apache.shardingsphere.sql.parser.binder.metadata.table.TableMetaData;
import org.apache.shardingsphere.infra.metadata.schema.spi.RuleMetaDataDecorator;
import org.apache.shardingsphere.infra.datanode.DataNode;
import java.util.Collection;
import java.util.HashSet;
......@@ -76,7 +77,7 @@ public final class ShardingMetaDataDecorator implements RuleMetaDataDecorator<Sh
@Override
public int getOrder() {
return 1;
return ShardingOrder.ORDER;
}
@Override
......
......@@ -19,18 +19,19 @@ package org.apache.shardingsphere.sharding.metadata;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.apache.shardingsphere.sharding.rule.TableRule;
import org.apache.shardingsphere.sql.parser.binder.metadata.schema.SchemaMetaData;
import org.apache.shardingsphere.sql.parser.binder.metadata.table.TableMetaData;
import org.apache.shardingsphere.sql.parser.binder.metadata.table.TableMetaDataLoader;
import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
import org.apache.shardingsphere.infra.config.properties.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.infra.exception.ShardingSphereException;
import org.apache.shardingsphere.infra.metadata.schema.spi.RuleMetaDataLoader;
import org.apache.shardingsphere.infra.datanode.DataNode;
import org.apache.shardingsphere.infra.datanode.DataNodes;
import org.apache.shardingsphere.infra.exception.ShardingSphereException;
import org.apache.shardingsphere.infra.metadata.schema.spi.RuleMetaDataLoader;
import org.apache.shardingsphere.sharding.constant.ShardingOrder;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.apache.shardingsphere.sharding.rule.TableRule;
import org.apache.shardingsphere.sql.parser.binder.metadata.schema.SchemaMetaData;
import org.apache.shardingsphere.sql.parser.binder.metadata.table.TableMetaData;
import org.apache.shardingsphere.sql.parser.binder.metadata.table.TableMetaDataLoader;
import javax.sql.DataSource;
import java.sql.SQLException;
......@@ -148,7 +149,7 @@ public final class ShardingMetaDataLoader implements RuleMetaDataLoader<Sharding
@Override
public int getOrder() {
return 1;
return ShardingOrder.ORDER;
}
@Override
......
......@@ -19,6 +19,7 @@ package org.apache.shardingsphere.sharding.rule;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import org.apache.shardingsphere.infra.rule.ShardingSphereRuleBuilder;
import org.apache.shardingsphere.sharding.constant.ShardingOrder;
import java.util.Collection;
......@@ -34,7 +35,7 @@ public final class ShardingRuleBuilder implements ShardingSphereRuleBuilder<Shar
@Override
public int getOrder() {
return 1;
return ShardingOrder.ORDER;
}
@Override
......
......@@ -17,11 +17,12 @@
package org.apache.shardingsphere.sharding.yaml.swapper;
import org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapper;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.TableRuleConfiguration;
import org.apache.shardingsphere.sharding.constant.ShardingOrder;
import org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration;
import org.apache.shardingsphere.sharding.yaml.config.YamlTableRuleConfiguration;
import org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapper;
import java.util.Map.Entry;
......@@ -90,6 +91,6 @@ public final class ShardingRuleConfigurationYamlSwapper implements YamlRuleConfi
@Override
public int getOrder() {
return 0;
return ShardingOrder.ORDER;
}
}
......@@ -17,6 +17,7 @@
package org.apache.shardingsphere.sharding.merge;
import org.apache.shardingsphere.sharding.constant.ShardingOrder;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.apache.shardingsphere.sharding.merge.dal.ShardingDALResultMerger;
import org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger;
......@@ -47,7 +48,7 @@ public final class ShardingResultMergerEngine implements ResultMergerEngine<Shar
@Override
public int getOrder() {
return 0;
return ShardingOrder.ORDER;
}
@Override
......
......@@ -18,14 +18,15 @@
package org.apache.shardingsphere.sharding.rewrite.context;
import lombok.Setter;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.apache.shardingsphere.sharding.rewrite.parameter.ShardingParameterRewriterBuilder;
import org.apache.shardingsphere.sharding.rewrite.token.pojo.ShardingTokenGenerateBuilder;
import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
import org.apache.shardingsphere.infra.rewrite.context.SQLRewriteContext;
import org.apache.shardingsphere.infra.rewrite.context.SQLRewriteContextDecorator;
import org.apache.shardingsphere.infra.rewrite.parameter.rewriter.ParameterRewriter;
import org.apache.shardingsphere.infra.route.context.RouteContext;
import org.apache.shardingsphere.sharding.constant.ShardingOrder;
import org.apache.shardingsphere.sharding.rewrite.parameter.ShardingParameterRewriterBuilder;
import org.apache.shardingsphere.sharding.rewrite.token.pojo.ShardingTokenGenerateBuilder;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
/**
* SQL rewrite context decorator for sharding.
......@@ -46,7 +47,7 @@ public final class ShardingSQLRewriteContextDecorator implements SQLRewriteConte
@Override
public int getOrder() {
return 0;
return ShardingOrder.ORDER;
}
@Override
......
......@@ -18,13 +18,13 @@
package org.apache.shardingsphere.sharding.route.engine;
import com.google.common.base.Preconditions;
import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
import org.apache.shardingsphere.infra.hint.HintManager;
import org.apache.shardingsphere.sharding.rule.BindingTableRule;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.apache.shardingsphere.sharding.rule.TableRule;
import org.apache.shardingsphere.sharding.strategy.route.hint.HintShardingStrategy;
import org.apache.shardingsphere.sharding.strategy.route.value.ListRouteValue;
import org.apache.shardingsphere.sharding.strategy.route.value.RouteValue;
import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
import org.apache.shardingsphere.infra.route.context.RouteContext;
import org.apache.shardingsphere.infra.route.context.RouteResult;
import org.apache.shardingsphere.infra.route.decorator.RouteDecorator;
import org.apache.shardingsphere.sharding.constant.ShardingOrder;
import org.apache.shardingsphere.sharding.route.engine.condition.ShardingCondition;
import org.apache.shardingsphere.sharding.route.engine.condition.ShardingConditions;
import org.apache.shardingsphere.sharding.route.engine.condition.engine.InsertClauseShardingConditionEngine;
......@@ -32,16 +32,17 @@ import org.apache.shardingsphere.sharding.route.engine.condition.engine.WhereCla
import org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngine;
import org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngineFactory;
import org.apache.shardingsphere.sharding.route.engine.validator.ShardingStatementValidatorFactory;
import org.apache.shardingsphere.sharding.rule.BindingTableRule;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.apache.shardingsphere.sharding.rule.TableRule;
import org.apache.shardingsphere.sharding.strategy.route.hint.HintShardingStrategy;
import org.apache.shardingsphere.sharding.strategy.route.value.ListRouteValue;
import org.apache.shardingsphere.sharding.strategy.route.value.RouteValue;
import org.apache.shardingsphere.sql.parser.binder.metadata.schema.SchemaMetaData;
import org.apache.shardingsphere.sql.parser.binder.statement.SQLStatementContext;
import org.apache.shardingsphere.sql.parser.binder.statement.dml.InsertStatementContext;
import org.apache.shardingsphere.sql.parser.binder.statement.dml.SelectStatementContext;
import org.apache.shardingsphere.sql.parser.sql.statement.dml.DMLStatement;
import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
import org.apache.shardingsphere.infra.route.context.RouteContext;
import org.apache.shardingsphere.infra.route.context.RouteResult;
import org.apache.shardingsphere.infra.route.decorator.RouteDecorator;
import java.util.Collections;
import java.util.List;
......@@ -154,7 +155,7 @@ public final class ShardingRouteDecorator implements RouteDecorator<ShardingRule
@Override
public int getOrder() {
return 0;
return ShardingOrder.ORDER;
}
@Override
......
......@@ -36,7 +36,6 @@ public class ExecutionContext {
private final Collection<ExecutionUnit> executionUnits;
public ExecutionContext(final SQLStatementContext sqlStatementContext, final ExecutionUnit executionUnit) {
this.sqlStatementContext = sqlStatementContext;
executionUnits = Collections.singletonList(executionUnit);
this(sqlStatementContext, Collections.singletonList(executionUnit));
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册