shalnisundram commented on code in PR #272:
URL: https://github.com/apache/cassandra-sidecar/pull/272#discussion_r2482820726
##########
adapters/adapters-base/src/main/java/org/apache/cassandra/sidecar/adapters/base/CassandraCompactionManagerOperations.java:
##########
@@ -53,4 +53,27 @@ public List<Map<String, String>> getCompactions()
return jmxClient.proxy(CompactionManagerJmxOperations.class,
COMPACTION_MANAGER_OBJ_NAME)
.getCompactions();
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void stopCompaction(String compactionId, String compactionType)
+ {
+ CompactionManagerJmxOperations proxy = jmxClient.proxy(
+ CompactionManagerJmxOperations.class,
+ COMPACTION_MANAGER_OBJ_NAME
+ );
+
+ // compactionId takes precedence over type if both are provided
+ if (compactionId != null && !compactionId.trim().isEmpty())
+ {
+ proxy.stopCompactionById(compactionId);
+ }
+ else
+ {
+ // Handler guarantees compactionType is non-null/non-empty
+ proxy.stopCompaction(compactionType);
Review Comment:
See change on [CassandraCompactionManagerOperations line 77
](https://github.com/shalnisundram/cassandra-sidecar/blob/6d42f45dbdbbc30da2149990272d2494ca437227/adapters/adapters-base/src/main/java/org/apache/cassandra/sidecar/adapters/base/CassandraCompactionManagerOperations.java#L77).
Not exactly an annotation but a requireNonNull check. Let me know if that's
acceptable.
--
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]