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

Move DataNode to shardingsphere-common module (#4917)

* for code style

* Move DataNode to shardingsphere-common module
上级 b33bc970
......@@ -20,7 +20,7 @@ package org.apache.shardingsphere.core.metadata;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.core.rule.ShardingRule;
import org.apache.shardingsphere.core.rule.TableRule;
import org.apache.shardingsphere.spi.database.type.DatabaseType;
......
......@@ -17,7 +17,7 @@
package org.apache.shardingsphere.core.metadata;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.core.rule.ShardingRule;
import org.apache.shardingsphere.core.rule.TableRule;
import org.apache.shardingsphere.sql.parser.binder.metadata.column.ColumnMetaData;
......
......@@ -34,6 +34,7 @@ import org.apache.shardingsphere.spi.algorithm.keygen.ShardingKeyGeneratorServic
import org.apache.shardingsphere.spi.keygen.ShardingKeyGenerator;
import org.apache.shardingsphere.underlying.common.config.exception.ShardingSphereConfigurationException;
import org.apache.shardingsphere.underlying.common.rule.BaseRule;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import java.util.Collection;
import java.util.LinkedList;
......
......@@ -31,6 +31,7 @@ import org.apache.shardingsphere.core.strategy.route.ShardingStrategy;
import org.apache.shardingsphere.core.strategy.route.ShardingStrategyFactory;
import org.apache.shardingsphere.underlying.common.config.inline.InlineExpressionParser;
import org.apache.shardingsphere.spi.keygen.ShardingKeyGenerator;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import java.util.Collection;
import java.util.Collections;
......
......@@ -30,6 +30,7 @@ import org.apache.shardingsphere.core.strategy.keygen.fixture.IncrementShardingK
import org.apache.shardingsphere.core.strategy.route.inline.InlineShardingStrategy;
import org.apache.shardingsphere.core.strategy.route.none.NoneShardingStrategy;
import org.apache.shardingsphere.underlying.common.config.exception.ShardingSphereConfigurationException;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.junit.Test;
import java.util.Arrays;
......
......@@ -25,6 +25,7 @@ import org.apache.shardingsphere.api.config.sharding.strategy.InlineShardingStra
import org.apache.shardingsphere.api.config.sharding.strategy.NoneShardingStrategyConfiguration;
import org.apache.shardingsphere.core.strategy.keygen.fixture.IncrementShardingKeyGenerator;
import org.apache.shardingsphere.underlying.common.config.exception.ShardingSphereConfigurationException;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.junit.Test;
import java.util.Arrays;
......
......@@ -18,7 +18,7 @@
package org.apache.shardingsphere.sharding.rewrite.engine;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.core.rule.ShardingRule;
import org.apache.shardingsphere.sharding.rewrite.sql.ShardingSQLBuilder;
import org.apache.shardingsphere.sharding.route.engine.condition.ShardingCondition;
......@@ -48,8 +48,7 @@ public final class ShardingSQLRewriteEngine implements SQLRewriteEngine {
@Override
public SQLRewriteResult rewrite(final SQLRewriteContext sqlRewriteContext) {
return new SQLRewriteResult(
new ShardingSQLBuilder(sqlRewriteContext, shardingRule, routeUnit).toSQL(), getParameters(sqlRewriteContext.getParameterBuilder()));
return new SQLRewriteResult(new ShardingSQLBuilder(sqlRewriteContext, shardingRule, routeUnit).toSQL(), getParameters(sqlRewriteContext.getParameterBuilder()));
}
private List<Object> getParameters(final ParameterBuilder parameterBuilder) {
......
......@@ -18,7 +18,7 @@
package org.apache.shardingsphere.sharding.rewrite.token.generator.impl;
import lombok.Setter;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.sharding.rewrite.aware.ShardingRouteContextAware;
import org.apache.shardingsphere.sharding.rewrite.token.pojo.impl.ShardingInsertValue;
import org.apache.shardingsphere.sharding.rewrite.token.pojo.impl.ShardingInsertValuesToken;
......
......@@ -18,7 +18,7 @@
package org.apache.shardingsphere.sharding.rewrite.token.pojo.impl;
import lombok.Getter;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.sql.parser.sql.segment.dml.expr.ExpressionSegment;
import org.apache.shardingsphere.underlying.rewrite.sql.token.pojo.generic.InsertValue;
......
......@@ -17,7 +17,7 @@
package org.apache.shardingsphere.sharding.rewrite.token.pojo.impl;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.sharding.rewrite.token.pojo.RouteUnitAware;
import org.apache.shardingsphere.underlying.rewrite.sql.token.pojo.generic.InsertValue;
import org.apache.shardingsphere.underlying.rewrite.sql.token.pojo.generic.InsertValuesToken;
......
......@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sharding.route.engine.condition;
import lombok.Getter;
import lombok.ToString;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.core.strategy.route.value.RouteValue;
import java.util.Collection;
......
......@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sharding.route.engine.type.broadcast;
import com.google.common.base.Preconditions;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.core.rule.ShardingRule;
import org.apache.shardingsphere.core.rule.TableRule;
import org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngine;
......
......@@ -21,7 +21,7 @@ import com.google.common.base.Preconditions;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.api.hint.HintManager;
import org.apache.shardingsphere.core.rule.BindingTableRule;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.core.rule.ShardingRule;
import org.apache.shardingsphere.core.rule.TableRule;
import org.apache.shardingsphere.core.strategy.route.ShardingStrategy;
......@@ -61,7 +61,7 @@ public final class ShardingStandardRoutingEngine implements ShardingRouteEngine
private final SQLStatementContext sqlStatementContext;
private final ShardingConditions shardingConditions;
private final ConfigurationProperties properties;
@Override
......
......@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sharding.route.engine.type.unicast;
import com.google.common.collect.Sets;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.core.rule.ShardingRule;
import org.apache.shardingsphere.core.rule.TableRule;
import org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngine;
......
......@@ -18,7 +18,7 @@
package org.apache.shardingsphere.sharding.route.engine.type.broadcast;
import com.google.common.collect.Maps;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.core.rule.ShardingDataSourceNames;
import org.apache.shardingsphere.core.rule.ShardingRule;
import org.apache.shardingsphere.core.rule.TableRule;
......
......@@ -18,7 +18,7 @@
package org.apache.shardingsphere.dbtest.cases.dataset;
import lombok.Getter;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.underlying.common.config.inline.InlineExpressionParser;
import org.apache.shardingsphere.dbtest.cases.dataset.metadata.DataSetMetadata;
import org.apache.shardingsphere.dbtest.cases.dataset.row.DataSetRow;
......
......@@ -19,7 +19,7 @@ package org.apache.shardingsphere.dbtest.engine;
import lombok.AccessLevel;
import lombok.Getter;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.dbtest.cases.assertion.root.IntegrateTestCase;
import org.apache.shardingsphere.dbtest.cases.assertion.root.IntegrateTestCaseAssertion;
import org.apache.shardingsphere.dbtest.cases.dataset.DataSet;
......
......@@ -17,7 +17,7 @@
package org.apache.shardingsphere.dbtest.engine.dml;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.underlying.common.config.inline.InlineExpressionParser;
import org.apache.shardingsphere.dbtest.cases.assertion.dml.DMLIntegrateTestCaseAssertion;
import org.apache.shardingsphere.dbtest.cases.dataset.DataSet;
......
......@@ -19,7 +19,7 @@ package org.apache.shardingsphere.dbtest.env.dataset;
import com.google.common.base.Joiner;
import org.apache.shardingsphere.underlying.common.database.type.DatabaseTypes;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.underlying.common.config.inline.InlineExpressionParser;
import org.apache.shardingsphere.dbtest.cases.assertion.root.SQLValue;
import org.apache.shardingsphere.dbtest.cases.assertion.root.SQLValueGroup;
......
......@@ -17,7 +17,7 @@
package org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.metadata;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.core.rule.ShardingRule;
import org.apache.shardingsphere.shardingjdbc.jdbc.adapter.WrapperAdapter;
import org.apache.shardingsphere.shardingjdbc.jdbc.core.resultset.DatabaseMetaDataResultSet;
......
......@@ -17,7 +17,7 @@
package org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.metadata;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.core.rule.ShardingDataSourceNames;
import org.apache.shardingsphere.core.rule.ShardingRule;
import org.apache.shardingsphere.core.rule.TableRule;
......
......@@ -19,7 +19,7 @@ package org.apache.shardingsphere.shardingjdbc.orchestration.spring.boot.type;
import lombok.SneakyThrows;
import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.core.rule.ShardingRule;
import org.apache.shardingsphere.core.rule.TableRule;
import org.apache.shardingsphere.core.strategy.route.inline.InlineShardingStrategy;
......
......@@ -19,7 +19,7 @@ package org.apache.shardingsphere.shardingjdbc.orchestration.spring.boot.type;
import lombok.SneakyThrows;
import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.core.rule.ShardingRule;
import org.apache.shardingsphere.core.rule.TableRule;
import org.apache.shardingsphere.core.strategy.route.inline.InlineShardingStrategy;
......
......@@ -20,7 +20,7 @@ package org.apache.shardingsphere.shardingjdbc.orchestration.spring;
import org.apache.shardingsphere.api.config.sharding.strategy.InlineShardingStrategyConfiguration;
import org.apache.shardingsphere.api.config.sharding.strategy.StandardShardingStrategyConfiguration;
import org.apache.shardingsphere.core.rule.BindingTableRule;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.core.rule.ShardingRule;
import org.apache.shardingsphere.core.rule.TableRule;
import org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.ShardingDataSource;
......
......@@ -19,7 +19,7 @@ package org.apache.shardingsphere.shardingjdbc.spring.boot.type;
import lombok.SneakyThrows;
import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.core.rule.ShardingRule;
import org.apache.shardingsphere.core.rule.TableRule;
import org.apache.shardingsphere.core.strategy.route.inline.InlineShardingStrategy;
......
......@@ -23,7 +23,7 @@ import org.apache.shardingsphere.api.config.sharding.strategy.InlineShardingStra
import org.apache.shardingsphere.api.config.sharding.strategy.NoneShardingStrategyConfiguration;
import org.apache.shardingsphere.api.config.sharding.strategy.StandardShardingStrategyConfiguration;
import org.apache.shardingsphere.core.rule.BindingTableRule;
import org.apache.shardingsphere.core.rule.DataNode;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.core.rule.ShardingRule;
import org.apache.shardingsphere.core.rule.TableRule;
import org.apache.shardingsphere.core.strategy.masterslave.RandomMasterSlaveLoadBalanceAlgorithm;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.shardingsphere.core.rule;
package org.apache.shardingsphere.underlying.common.rule;
import com.google.common.base.Objects;
import com.google.common.base.Splitter;
......@@ -27,7 +27,7 @@ import org.apache.shardingsphere.underlying.common.config.exception.ShardingSphe
import java.util.List;
/**
* Sharding data unit node.
* Data node.
*/
@RequiredArgsConstructor
@Getter
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.shardingsphere.core.rule;
package org.apache.shardingsphere.underlying.common.rule;
import org.apache.shardingsphere.underlying.common.config.exception.ShardingSphereConfigurationException;
import org.junit.Test;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册