equal
deleted
inserted
replaced
43 * } |
43 * } |
44 * </pre> |
44 * </pre> |
45 * <p> |
45 * <p> |
46 * |
46 * |
47 * A {@link ShardingKey} is used for specifying a |
47 * A {@link ShardingKey} is used for specifying a |
48 * {@link AdbaConnectionProperty#SHARDING_KEY} or a |
48 * {@link AdbaSessionProperty#SHARDING_KEY} or a |
49 * {@link AdbaConnectionProperty#SHARDING_GROUP_KEY}. Databases that support |
49 * {@link AdbaSessionProperty#SHARDING_GROUP_KEY}. Databases that support |
50 * composite Sharding may use a * to specify a additional level of partitioning |
50 * composite Sharding may use a * to specify a additional level of partitioning |
51 * within to specify a additional level of partitioning within the Shard. |
51 * within to specify a additional level of partitioning within the Shard. |
52 * <p> |
52 * <p> |
53 * The following example illustrates the use of {@link Builder} to create a |
53 * The following example illustrates the use of {@link Builder} to create a |
54 * {@link AdbaConnectionProperty#SHARDING_GROUP_KEY} for an eastern region with |
54 * {@link AdbaSessionProperty#SHARDING_GROUP_KEY} for an eastern region with |
55 * a {@link AdbaConnectionProperty#SHARDING_KEY} specified for the Pittsburgh |
55 * a {@link AdbaSessionProperty#SHARDING_KEY} specified for the Pittsburgh |
56 * branch office: |
56 * branch office: |
57 * <pre> |
57 * <pre> |
58 * {@code |
58 * {@code |
59 * |
59 * |
60 * DataSource ds = new MyDataSource(); |
60 * DataSource ds = new MyDataSource(); |
62 * .subkey("EASTERN_REGION", JDBCType.VARCHAR) |
62 * .subkey("EASTERN_REGION", JDBCType.VARCHAR) |
63 * .build(); |
63 * .build(); |
64 * ShardingKey shardingKey = ds.shardingKeyBuilder() |
64 * ShardingKey shardingKey = ds.shardingKeyBuilder() |
65 * .subkey("PITTSBURGH_BRANCH", JDBCType.VARCHAR) |
65 * .subkey("PITTSBURGH_BRANCH", JDBCType.VARCHAR) |
66 * .build(); |
66 * .build(); |
67 * Connection con = ds.builder() |
67 * Session con = ds.builder() |
68 * .property(SHARDING_GROUP_KEY, superShardingKey) |
68 * .property(SHARDING_GROUP_KEY, superShardingKey) |
69 * .property(SHARDING_KEY, shardingKey) |
69 * .property(SHARDING_KEY, shardingKey) |
70 * .build(); |
70 * .build(); |
71 * } |
71 * } |
72 * </pre> |
72 * </pre> |