@Test public void testIllegalShard() throws SQLException { ConditionList conditions = ConditionList.andList(); conditions.add(exp(SHARD_COL, SX)); try { test.locateDbShards(new ShardingContext("appId", "logicDbName", all(), new Hints(), conditions)); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); } }
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; }