arjunashok commented on code in PR #144:
URL: https://github.com/apache/cassandra-sidecar/pull/144#discussion_r1911475933
##########
adapters/base/src/main/java/org/apache/cassandra/sidecar/adapters/base/CassandraStorageOperations.java:
##########
@@ -213,4 +214,38 @@ public void outOfRangeDataCleanup(@NotNull String
keyspace, @NotNull String tabl
jmxClient.proxy(StorageJmxOperations.class, STORAGE_SERVICE_OBJ_NAME)
.forceKeyspaceCleanup(concurrency, keyspace, table);
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isDecommissioning()
+ {
+ StorageJmxOperations ssProxy =
jmxClient.proxy(StorageJmxOperations.class, STORAGE_SERVICE_OBJ_NAME);
+ String nodeOperationMode = ssProxy.getOperationMode();
+ // The following check is equivalent to the operation-mode checks
within Cassandra to determine if a
+ // decommission operation is in progress
+ return nodeOperationMode.equals("LEAVING") ||
nodeOperationMode.equals("DECOMMISSION_FAILED");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public OperationalJobStatus decommission(boolean force)
+ {
+ StorageJmxOperations ssProxy =
jmxClient.proxy(StorageJmxOperations.class, STORAGE_SERVICE_OBJ_NAME);
+ String mode = ssProxy.getOperationMode();
+ switch(mode)
+ {
+ case "LEAVING":
+ case "DECOMMISSION_FAILED":
+ return OperationalJobStatus.RUNNING;
Review Comment:
Same reason as above. THis used to be this way in C*. Addressed.
##########
adapters/base/src/main/java/org/apache/cassandra/sidecar/adapters/base/CassandraStorageOperations.java:
##########
@@ -213,4 +214,38 @@ public void outOfRangeDataCleanup(@NotNull String
keyspace, @NotNull String tabl
jmxClient.proxy(StorageJmxOperations.class, STORAGE_SERVICE_OBJ_NAME)
.forceKeyspaceCleanup(concurrency, keyspace, table);
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isDecommissioning()
+ {
+ StorageJmxOperations ssProxy =
jmxClient.proxy(StorageJmxOperations.class, STORAGE_SERVICE_OBJ_NAME);
+ String nodeOperationMode = ssProxy.getOperationMode();
Review Comment:
Addressed after offline sync in latest commits
--
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]