提交 cbb6c151 编写于 作者: H haocao

Merge remote-tracking branch 'origin/master'

......@@ -20,6 +20,9 @@ package com.dangdang.ddframe.rdb.sharding.executor;
/**
* 执行单元.
*
* @param <I> 入参类型
* @param <O> 出参类型
*
* @author gaohongtao
*/
public interface ExecuteUnit<I, O> {
......
......@@ -22,6 +22,9 @@ import java.util.List;
/**
* 合并执行单元.
*
* @param <I> 入参类型
* @param <O> 出参类型
*
* @author gaohongtao
*/
public interface MergeUnit<I, O> {
......
......@@ -24,7 +24,7 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* ShardingDataSource运行期上下文.
* 数据源运行期上下文.
*
* @author gaohongtao
*/
......
......@@ -89,7 +89,7 @@ public final class ParseContext {
private int itemIndex;
public ParseContext(final int parseContextIndex) {
this.autoGenTokenKey = String.format(AUTO_GEN_TOKE_KEY_TEMPLATE, parseContextIndex);
autoGenTokenKey = String.format(AUTO_GEN_TOKE_KEY_TEMPLATE, parseContextIndex);
}
/**
......
......@@ -118,8 +118,9 @@ public final class SingleTableRouter {
List<ShardingValue<?>> result = new ArrayList<>(shardingColumns.size());
for (String each : shardingColumns) {
Optional<ShardingValue<?>> shardingValue = HintManagerHolder.getDatabaseShardingValue(new ShardingKey(logicTable, each));
Preconditions.checkState(shardingValue.isPresent(), String.format("Can not find sharding hint for logic-table '%s' and sharding-column '%s'", logicTable, each));
result.add(shardingValue.get());
if (shardingValue.isPresent()) {
result.add(shardingValue.get());
}
}
return result;
}
......@@ -128,8 +129,9 @@ public final class SingleTableRouter {
List<ShardingValue<?>> result = new ArrayList<>(shardingColumns.size());
for (String each : shardingColumns) {
Optional<ShardingValue<?>> shardingValue = HintManagerHolder.getTableShardingValue(new ShardingKey(logicTable, each));
Preconditions.checkState(shardingValue.isPresent(), String.format("Can not find sharding hint for logic-table '%s' and sharding-column '%s'", logicTable, each));
result.add(shardingValue.get());
if (shardingValue.isPresent()) {
result.add(shardingValue.get());
}
}
return result;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册