You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sa...@apache.org on 2023/04/04 07:53:57 UTC
[cassandra] 17/44: [CEP-21] New nodetool commands
This is an automated email from the ASF dual-hosted git repository.
samt pushed a commit to branch cep-21-tcm
in repository https://gitbox.apache.org/repos/asf/cassandra.git
commit b18d21d93067b4c352083be875bc20e7c8b4dcfd
Author: Sam Tunnicliffe <sa...@apache.org>
AuthorDate: Fri Mar 3 15:41:59 2023 +0000
[CEP-21] New nodetool commands
Adds new nodetool commands to:
* list members of the CMS
* initiate a snapshot of ClusterMetadata via submitting a SealPeriod
operation
Co-authored-by: Marcus Eriksson <ma...@apache.org>
Co-authored-by: Alex Petrov <ol...@gmail.com>
Co-authored-by: Sam Tunnicliffe <sa...@apache.org>
---
src/java/org/apache/cassandra/tools/NodeProbe.java | 5 ++++
src/java/org/apache/cassandra/tools/NodeTool.java | 2 ++
.../cassandra/tools/nodetool/DescribeCMS.java | 34 ++++++++++++++++++++++
.../cassandra/tools/nodetool/SealPeriod.java | 33 +++++++++++++++++++++
4 files changed, 74 insertions(+)
diff --git a/src/java/org/apache/cassandra/tools/NodeProbe.java b/src/java/org/apache/cassandra/tools/NodeProbe.java
index e983e2fbef..ab051843f1 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -327,6 +327,11 @@ public class NodeProbe implements AutoCloseable
return ssProxy.forceKeyspaceCleanup(jobs, keyspaceName, tables);
}
+ public void sealPeriod()
+ {
+ ssProxy.sealPeriod();
+ }
+
public int scrub(boolean disableSnapshot, boolean skipCorrupted, boolean checkData, boolean reinsertOverflowedTTL, int jobs, String keyspaceName, String... tables) throws IOException, ExecutionException, InterruptedException
{
return ssProxy.scrub(disableSnapshot, skipCorrupted, checkData, reinsertOverflowedTTL, jobs, keyspaceName, tables);
diff --git a/src/java/org/apache/cassandra/tools/NodeTool.java b/src/java/org/apache/cassandra/tools/NodeTool.java
index 5500240477..35a673c406 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -107,6 +107,7 @@ public class NodeTool
DataPaths.class,
Decommission.class,
DescribeCluster.class,
+ DescribeCMS.class,
DescribeRing.class,
DisableAuditLog.class,
DisableAutoCompaction.class,
@@ -190,6 +191,7 @@ public class NodeTool
ResumeHandoff.class,
Ring.class,
Scrub.class,
+ SealPeriod.class,
SetAuthCacheConfig.class,
SetBatchlogReplayThrottle.class,
SetCacheCapacity.class,
diff --git a/src/java/org/apache/cassandra/tools/nodetool/DescribeCMS.java b/src/java/org/apache/cassandra/tools/nodetool/DescribeCMS.java
new file mode 100644
index 0000000000..ce34af4bf8
--- /dev/null
+++ b/src/java/org/apache/cassandra/tools/nodetool/DescribeCMS.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.tools.nodetool;
+
+import io.airlift.airline.Command;
+import org.apache.cassandra.tools.NodeProbe;
+import org.apache.cassandra.tools.NodeTool;
+
+@Command(name = "describecms", description = "Describe the current Cluster Metadata Service")
+public class DescribeCMS extends NodeTool.NodeToolCmd
+{
+ @Override
+ protected void execute(NodeProbe probe)
+ {
+ System.out.println("ClusterMetadataService:");
+ System.out.println(probe.getStorageService().describeCMS());
+ }
+}
diff --git a/src/java/org/apache/cassandra/tools/nodetool/SealPeriod.java b/src/java/org/apache/cassandra/tools/nodetool/SealPeriod.java
new file mode 100644
index 0000000000..65bd699ca3
--- /dev/null
+++ b/src/java/org/apache/cassandra/tools/nodetool/SealPeriod.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.tools.nodetool;
+
+import io.airlift.airline.Command;
+import org.apache.cassandra.tools.NodeProbe;
+import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
+
+@Command(name = "sealperiod", description = "seal current period in the metadata log")
+public class SealPeriod extends NodeToolCmd
+{
+ @Override
+ public void execute(NodeProbe probe)
+ {
+ probe.sealPeriod();
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org