@Test public void testLocateDbShards() throws SQLException { Set<String> exp; Condition condition; for(Object[] testData: data) { exp = (Set<String>)testData[0]; condition = (Condition)testData[1]; ConditionList conditions = ConditionList.andList(); conditions.add(condition); assertEquals(exp, test.locateDbShards(new ShardingContext("appId", "logicDbName", all(), new Hints(), conditions))); } }
public abstract Set<String> locateDbShards(ConditionContext ctx);
AbstractConditionStrategy extends AbstractShardingStrategy { public abstract Set<String> locateDbShards(ConditionContext ctx); }
AbstractConditionStrategy extends AbstractShardingStrategy { public abstract Set<String> locateDbShards(ConditionContext ctx);  }
AbstractConditionStrategy extends AbstractShardingStrategy { public abstract Set<String> locateDbShards(ConditionContext ctx);  abstract Set<String> locateDbShardsByValue(ShardingContext ctx, Object shardValue); abstract Set<String> locateDbShards(ConditionContext ctx); abstract Set<String> locateTableShardsByValue(TableShardingContext ctx, Object tableShardValue); abstract Set<String> locateTableShards(TableConditionContext ctx); @Override void initialize(Map<String, String> settings); @Override Set<String> locateDbShards(ShardingContext ctx); @Override Set<String> locateTableShards(TableShardingContext ctx); }
AbstractConditionStrategy extends AbstractShardingStrategy { public abstract Set<String> locateDbShards(ConditionContext ctx);  abstract Set<String> locateDbShardsByValue(ShardingContext ctx, Object shardValue); abstract Set<String> locateDbShards(ConditionContext ctx); abstract Set<String> locateTableShardsByValue(TableShardingContext ctx, Object tableShardValue); abstract Set<String> locateTableShards(TableConditionContext ctx); @Override void initialize(Map<String, String> settings); @Override Set<String> locateDbShards(ShardingContext ctx); @Override Set<String> locateTableShards(TableShardingContext ctx); static final String COLUMNS; static final String TABLE_COLUMNS; }