@@ -35,18 +35,29 @@ public class ShardingInfo implements NodeShardingInfo {
35
35
private static final String SCYLLA_PARTITIONER = "SCYLLA_PARTITIONER" ;
36
36
private static final String SCYLLA_SHARDING_ALGORITHM = "SCYLLA_SHARDING_ALGORITHM" ;
37
37
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" ;
38
40
39
41
private final int shardsCount ;
40
42
private final String partitioner ;
41
43
private final String shardingAlgorithm ;
42
44
private final int shardingIgnoreMSB ;
45
+ private final Integer shardAwarePort ;
46
+ private final Integer shardAwarePortSsl ;
43
47
44
48
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 ) {
46
55
this .shardsCount = shardsCount ;
47
56
this .partitioner = partitioner ;
48
57
this .shardingAlgorithm = shardingAlgorithm ;
49
58
this .shardingIgnoreMSB = shardingIgnoreMSB ;
59
+ this .shardAwarePort = shardAwarePort ;
60
+ this .shardAwarePortSsl = shardAwarePortSsl ;
50
61
}
51
62
52
63
@ Override
@@ -78,6 +89,16 @@ public int shardId(Token t) {
78
89
return (int ) (sum >>> 32 );
79
90
}
80
91
92
+ @ Override
93
+ public Integer getShardAwarePort () {
94
+ return shardAwarePort ;
95
+ }
96
+
97
+ @ Override
98
+ public Integer getShardAwarePortSsl () {
99
+ return shardAwarePortSsl ;
100
+ }
101
+
81
102
public static class ConnectionShardingInfo {
82
103
public final int shardId ;
83
104
public final ShardingInfo shardingInfo ;
@@ -94,6 +115,8 @@ public static ConnectionShardingInfo parseShardingInfo(Map<String, List<String>>
94
115
String partitioner = parseString (params , SCYLLA_PARTITIONER );
95
116
String shardingAlgorithm = parseString (params , SCYLLA_SHARDING_ALGORITHM );
96
117
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 );
97
120
if (shardId == null
98
121
|| shardsCount == null
99
122
|| partitioner == null
@@ -104,7 +127,14 @@ public static ConnectionShardingInfo parseShardingInfo(Map<String, List<String>>
104
127
return null ;
105
128
}
106
129
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 ));
108
138
}
109
139
110
140
private static String parseString (Map <String , List <String >> params , String key ) {
0 commit comments