diff --git a/CHANGES.txt b/CHANGES.txt index bea407e08e..6d84bc8976 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 4.0 + * Add nodetool cmd to print hinted handoff window (CASSANDRA-13728) * Checksum sstable metadata (CASSANDRA-13321, CASSANDRA-13593) * Add result set metadata to prepared statement MD5 hash calculation (CASSANDRA-10786) * Refactor GcCompactionTest to avoid boxing (CASSANDRA-13941) diff --git a/src/java/org/apache/cassandra/tools/NodeTool.java b/src/java/org/apache/cassandra/tools/NodeTool.java index 640cf364ed..8618d870f0 100644 --- a/src/java/org/apache/cassandra/tools/NodeTool.java +++ b/src/java/org/apache/cassandra/tools/NodeTool.java @@ -147,7 +147,8 @@ public class NodeTool FailureDetectorInfo.class, RefreshSizeEstimates.class, RelocateSSTables.class, - ViewBuildStatus.class + ViewBuildStatus.class, + HandoffWindow.class ); Cli.CliBuilder builder = Cli.builder("nodetool"); diff --git a/src/java/org/apache/cassandra/tools/nodetool/HandoffWindow.java b/src/java/org/apache/cassandra/tools/nodetool/HandoffWindow.java new file mode 100644 index 0000000000..b4adb7f0b7 --- /dev/null +++ b/src/java/org/apache/cassandra/tools/nodetool/HandoffWindow.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; + +@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())); + } +}