You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ To activate this throttler, modify the {@code advanced.throttler} section in the
40
40
advanced.throttler = {
41
41
class = com.aws.ssa.keyspaces.throttler.AmazonKeyspacesFixedRateThrottler
42
42
max-requests-per-second = 1000
43
-
endpoint-type = VPC
43
+
number-of-hosts = 3
44
44
register-timeout = 1 seconds
45
45
}
46
46
}
@@ -49,7 +49,7 @@ To activate this throttler, modify the {@code advanced.throttler} section in the
49
49
50
50
51
51
*`max-requests-per-second` : controls the request rate. Blocks until available permits or timeout it reached
52
-
*`endpoint-type` : if you are connected to the VPC endpoint or the public endpoint. Used to determine throughput based on the number of connections specified in:`advanced.connection.pool.local.size`
52
+
*`number-of-hosts` : The number of hosts in the system.peers table. Depending on the endpoint type and region the number of hosts in the system.peers table may be different. This number is Used to validate throughput based on the number of connections specified in:`advanced.connection.pool.local.size`
53
53
*`register-timeout` timeout waiting for permits. Should be less than or equal to `basic.request.timeout'
@@ -69,10 +68,10 @@ public class AmazonKeyspacesFixedRateThrottler implements RequestThrottler {
69
68
publicstaticintPUBLIC_ENDPOINT_DEFAULT_HOST = 9;
70
69
71
70
/***
72
-
* Amazon Keyspaces Virtual Private Cloud Endpoint (VPCE) exposes single host to drivers. The default behavior will establish one connection for every conection specified in
71
+
* Amazon Keyspaces Virtual Private Cloud Endpoint (VPCE) exposes host per availability zone. The default behavior will establish one connection to each peer IP address.
73
72
* the driver.
74
73
*/
75
-
publicstaticintVPC_ENDPOINT_DEFAULT_HOST = 1;
74
+
publicstaticintVPC_ENDPOINT_DEFAULT_HOST = 2;
76
75
77
76
/***
78
77
* Rate limiter used to meter the CQL Request Per Second up to maxRequestsPerSecond
@@ -85,9 +84,9 @@ public class AmazonKeyspacesFixedRateThrottler implements RequestThrottler {
85
84
privatefinalRateLimitermaxConnectionsLimiter;
86
85
87
86
/***
88
-
* Type of endpoint used which dictate the number of connections generated when creating a new session
87
+
* Number of hosts available when creating to a new session
89
88
*/
90
-
privatefinalEndpointTypeendpointType;
89
+
privatefinalIntegernumberOfHosts;
91
90
92
91
/***
93
92
* Configured Rate of desired throughput
@@ -116,9 +115,9 @@ public AmazonKeyspacesFixedRateThrottler(DriverContext context) {
"[{}] Cannot reach Max Request Per Second of {}. Specified Endpoint type of {}, and number of connections {} will provide at most {} request per second. Try increasing advanced.connection.pool.local.size ",
200
+
"[{}] Cannot reach Max Request Per Second of {}. Specified number of hosts {}, and number of connections {} will provide at most {} request per second. Try increasing advanced.connection.pool.local.size or check system.peers table fo the number of hosts ",
202
201
logPrefix,
203
202
maxRequestsPerSecond,
204
-
endpointType,
203
+
numberOfHosts,
205
204
numberOfConnectionsPerHost,
206
205
maxRequestPerSecondByForConnections);
207
206
@@ -218,27 +217,23 @@ public AmazonKeyspacesFixedRateThrottler(DriverContext context, long maxRequests
218
217
219
218
/***
220
219
* Calculate the number of request per second based on the number of connections, number of hosts, and 2000 request per second.
221
-
* @param endpointType VPC or Public Endpoint
220
+
* @param numberOfHosts Number of hosts in the peers table. Depends on region and end point
222
221
* @param numberOfConnectionsPerHost Number of connections for each host ip
223
222
* @return max rate per second based on the number of connections
* Calculate recommended connections based on the current maxRequestRate specified. Max Connections rate should be greater than configured max request rate
233
230
* @param maxRequestsPerSecond number of configured request per second
234
-
* @param endpointType type of endpoint that will be used to identify the number of hosts
231
+
* @param numberOfHosts type of endpoint that will be used to identify the number of hosts
0 commit comments