This is an automated email from the ASF dual-hosted git repository. jwest pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/trunk by this push: new d489545 Clean up redundant nodetool commands added in 4.0 d489545 is described below commit d48954563802b1c2d42fd0bf5062568baae5b0eb Author: Chris Lohfink <clohf...@apple.com> AuthorDate: Fri Aug 2 12:29:09 2019 -0500 Clean up redundant nodetool commands added in 4.0 Patch by Chris Lohfink; Reviewed by Jordan West for CASSANDRA-15256 --- CHANGES.txt | 1 + .../apache/cassandra/service/StorageService.java | 10 ----- .../cassandra/service/StorageServiceMBean.java | 2 - src/java/org/apache/cassandra/tools/NodeProbe.java | 7 +--- src/java/org/apache/cassandra/tools/NodeTool.java | 3 -- .../cassandra/tools/nodetool/GetReplicas.java | 47 ---------------------- .../cassandra/tools/nodetool/HandoffWindow.java | 33 --------------- 7 files changed, 2 insertions(+), 101 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index e617498..e6868e9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 4.0-alpha5 + * Cleanup redundant nodetool commands added in 4.0 (CASSANDRA-15256) * Update to Python driver 3.23 for cqlsh (CASSANDRA-15793) * Add tunable initial size and growth factor to RangeTombstoneList (CASSANDRA-15763) * Improve debug logging in SSTableReader for index summary (CASSANDRA-15755) diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java index c01665b..38da4e8 100644 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@ -4002,16 +4002,6 @@ public class StorageService extends NotificationBroadcasterSupport implements IE return Replicas.stringify(replicas, true); } - public List<String> getReplicas(String keyspaceName, String cf, String key) - { - List<String> res = new ArrayList<>(); - for (Replica replica : getNaturalReplicasForToken(keyspaceName, cf, key)) - { - res.add(replica.toString()); - } - return res; - } - public EndpointsForToken getNaturalReplicasForToken(String keyspaceName, String cf, String key) { KeyspaceMetadata ksMetaData = Schema.instance.getKeyspaceMetadata(keyspaceName); diff --git a/src/java/org/apache/cassandra/service/StorageServiceMBean.java b/src/java/org/apache/cassandra/service/StorageServiceMBean.java index 432b0bc..7574010 100644 --- a/src/java/org/apache/cassandra/service/StorageServiceMBean.java +++ b/src/java/org/apache/cassandra/service/StorageServiceMBean.java @@ -219,8 +219,6 @@ public interface StorageServiceMBean extends NotificationEmitter @Deprecated public List<InetAddress> getNaturalEndpoints(String keyspaceName, ByteBuffer key); public List<String> getNaturalEndpointsWithPort(String keysapceName, ByteBuffer key); - public List<String> getReplicas(String keyspaceName, String cf, String key); - /** * @deprecated use {@link #takeSnapshot(String tag, Map options, String... entities)} instead. */ diff --git a/src/java/org/apache/cassandra/tools/NodeProbe.java b/src/java/org/apache/cassandra/tools/NodeProbe.java index 9277278..f911eb5 100644 --- a/src/java/org/apache/cassandra/tools/NodeProbe.java +++ b/src/java/org/apache/cassandra/tools/NodeProbe.java @@ -822,11 +822,6 @@ public class NodeProbe implements AutoCloseable return ssProxy.getNaturalEndpoints(keyspace, cf, key); } - public List<String> getReplicas(String keyspace, String cf, String key) - { - return ssProxy.getReplicas(keyspace, cf, key); - } - public List<String> getSSTables(String keyspace, String cf, String key, boolean hexFormat) { ColumnFamilyStoreMBean cfsProxy = getCfsProxy(keyspace, cf); @@ -1601,7 +1596,7 @@ public class NodeProbe implements AutoCloseable /** * Retrieve Proxy metrics - * @param connections, connectedNativeClients, connectedNativeClientsByUser, clientsByProtocolVersion + * @param metricName */ public Object getClientMetric(String metricName) { diff --git a/src/java/org/apache/cassandra/tools/NodeTool.java b/src/java/org/apache/cassandra/tools/NodeTool.java index 5af3fb1..bf5e5cc 100644 --- a/src/java/org/apache/cassandra/tools/NodeTool.java +++ b/src/java/org/apache/cassandra/tools/NodeTool.java @@ -205,12 +205,9 @@ public class NodeTool RefreshSizeEstimates.class, RelocateSSTables.class, ViewBuildStatus.class, - HandoffWindow.class, ReloadSslCertificates.class, EnableAuditLog.class, DisableAuditLog.class, - GetReplicas.class, - DisableAuditLog.class, EnableOldProtocolVersions.class, DisableOldProtocolVersions.class ); diff --git a/src/java/org/apache/cassandra/tools/nodetool/GetReplicas.java b/src/java/org/apache/cassandra/tools/nodetool/GetReplicas.java deleted file mode 100644 index 4c401fc..0000000 --- a/src/java/org/apache/cassandra/tools/nodetool/GetReplicas.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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 java.util.ArrayList; -import java.util.List; - -import io.airlift.airline.Arguments; -import io.airlift.airline.Command; -import org.apache.cassandra.tools.NodeProbe; -import org.apache.cassandra.tools.NodeTool; - -import static com.google.common.base.Preconditions.checkArgument; - -@Command(name = "getreplicas", description = "Print replicas for a given key") -public class GetReplicas extends NodeTool.NodeToolCmd -{ - @Arguments(usage = "<keyspace> <table> <key>", description = "The keyspace, the table, and the partition key for which we need to find replicas") - private List<String> args = new ArrayList<>(); - - @Override - public void execute(NodeProbe probe) - { - checkArgument(args.size() == 3, "getreplicas requires keyspace, table and partition key arguments"); - String ks = args.get(0); - String table = args.get(1); - String key = args.get(2); - - System.out.println(probe.getReplicas(ks, table, key)); - } -} diff --git a/src/java/org/apache/cassandra/tools/nodetool/HandoffWindow.java b/src/java/org/apache/cassandra/tools/nodetool/HandoffWindow.java deleted file mode 100644 index b4adb7f..0000000 --- a/src/java/org/apache/cassandra/tools/nodetool/HandoffWindow.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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 = "handoffwindow", description = "Print current hinted handoff window") -public class HandoffWindow extends NodeTool.NodeToolCmd -{ - @Override - public void execute(NodeProbe probe) - { - System.out.println(String.format("Hinted handoff window is %s", - probe.getMaxHintWindow())); - } -} --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org