frankgh commented on code in PR #97:
URL: https://github.com/apache/cassandra-sidecar/pull/97#discussion_r1483564969
##########
src/main/java/org/apache/cassandra/sidecar/server/ServerVerticle.java:
##########
@@ -114,6 +120,24 @@ Future<CompositeFuture> updateSSLOptions(SSLOptions
options)
.collect(Collectors.toList()));
}
+ /**
+ * Updates the {@link TrafficShapingOptions} internally for the deployed
server.
+ *
+ * @param options the updated traffic shaping options
+ * @return a future signaling the update success
+ */
+ Future<Void> updateTrafficShapingOptions(TrafficShapingOptions options)
+ {
+ List<HttpServer> deployedServers = this.deployedServers;
+ if (deployedServers == null || deployedServers.isEmpty())
+ {
+ return Future.failedFuture("No servers are running");
+ }
+ return executorPools.service().executeBlocking(promise -> {
+ deployedServers.forEach(server ->
server.updateTrafficShapingOptions(options));
Review Comment:
this is not really blocking, everything is CPU bound
##########
src/main/java/org/apache/cassandra/sidecar/server/Server.java:
##########
@@ -189,6 +191,22 @@ public Future<CompositeFuture> updateSSLOptions(long
timestamp)
return Future.all(updateFutures);
}
+ /**
+ * Updates the traffic shaping options for all servers in all the deployed
verticle instances
+ *
+ * @param options update traffic shaping options
+ * @return a future to indicate the update was successfully completed
+ */
+ public Future<CompositeFuture>
updateTrafficShapingOptions(TrafficShapingOptions options)
Review Comment:
can we add tests for this please?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]