@@ -35,18 +35,29 @@ public class ShardingInfo implements NodeShardingInfo {
3535 private static final String SCYLLA_PARTITIONER = "SCYLLA_PARTITIONER" ;
3636 private static final String SCYLLA_SHARDING_ALGORITHM = "SCYLLA_SHARDING_ALGORITHM" ;
3737 private static final String SCYLLA_SHARDING_IGNORE_MSB = "SCYLLA_SHARDING_IGNORE_MSB" ;
38+ private static final String SCYLLA_SHARD_AWARE_PORT_PARAM_KEY = "SCYLLA_SHARD_AWARE_PORT" ;
39+ private static final String SCYLLA_SHARD_AWARE_PORT_SSL_PARAM_KEY = "SCYLLA_SHARD_AWARE_PORT_SSL" ;
3840
3941 private final int shardsCount ;
4042 private final String partitioner ;
4143 private final String shardingAlgorithm ;
4244 private final int shardingIgnoreMSB ;
45+ private final Integer shardAwarePort ;
46+ private final Integer shardAwarePortSsl ;
4347
4448 private ShardingInfo (
45- int shardsCount , String partitioner , String shardingAlgorithm , int shardingIgnoreMSB ) {
49+ int shardsCount ,
50+ String partitioner ,
51+ String shardingAlgorithm ,
52+ int shardingIgnoreMSB ,
53+ Integer shardAwarePort ,
54+ Integer shardAwarePortSsl ) {
4655 this .shardsCount = shardsCount ;
4756 this .partitioner = partitioner ;
4857 this .shardingAlgorithm = shardingAlgorithm ;
4958 this .shardingIgnoreMSB = shardingIgnoreMSB ;
59+ this .shardAwarePort = shardAwarePort ;
60+ this .shardAwarePortSsl = shardAwarePortSsl ;
5061 }
5162
5263 @ Override
@@ -78,6 +89,16 @@ public int shardId(Token t) {
7889 return (int ) (sum >>> 32 );
7990 }
8091
92+ @ Override
93+ public Integer getShardAwarePort () {
94+ return shardAwarePort ;
95+ }
96+
97+ @ Override
98+ public Integer getShardAwarePortSsl () {
99+ return shardAwarePortSsl ;
100+ }
101+
81102 public static class ConnectionShardingInfo {
82103 public final int shardId ;
83104 public final ShardingInfo shardingInfo ;
@@ -94,6 +115,8 @@ public static ConnectionShardingInfo parseShardingInfo(Map<String, List<String>>
94115 String partitioner = parseString (params , SCYLLA_PARTITIONER );
95116 String shardingAlgorithm = parseString (params , SCYLLA_SHARDING_ALGORITHM );
96117 Integer shardingIgnoreMSB = parseInt (params , SCYLLA_SHARDING_IGNORE_MSB );
118+ Integer shardAwarePort = parseInt (params , SCYLLA_SHARD_AWARE_PORT_PARAM_KEY );
119+ Integer shardAwarePortSsl = parseInt (params , SCYLLA_SHARD_AWARE_PORT_SSL_PARAM_KEY );
97120 if (shardId == null
98121 || shardsCount == null
99122 || partitioner == null
@@ -104,7 +127,14 @@ public static ConnectionShardingInfo parseShardingInfo(Map<String, List<String>>
104127 return null ;
105128 }
106129 return new ConnectionShardingInfo (
107- shardId , new ShardingInfo (shardsCount , partitioner , shardingAlgorithm , shardingIgnoreMSB ));
130+ shardId ,
131+ new ShardingInfo (
132+ shardsCount ,
133+ partitioner ,
134+ shardingAlgorithm ,
135+ shardingIgnoreMSB ,
136+ shardAwarePort ,
137+ shardAwarePortSsl ));
108138 }
109139
110140 private static String parseString (Map <String , List <String >> params , String key ) {
0 commit comments