Add nodetool cmd to print hinted handoff window

Patch by Varun Gupta; Reviewed by Jeff Jirsa for CASSANDRA-13728
This commit is contained in:
Varun Gupta 2017-08-18 10:17:47 -07:00 committed by Jeff Jirsa
parent 589501d8e2
commit 0b50887989
3 changed files with 36 additions and 1 deletions

View File

@ -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)

View File

@ -147,7 +147,8 @@ public class NodeTool
FailureDetectorInfo.class,
RefreshSizeEstimates.class,
RelocateSSTables.class,
ViewBuildStatus.class
ViewBuildStatus.class,
HandoffWindow.class
);
Cli.CliBuilder<Runnable> builder = Cli.builder("nodetool");

View File

@ -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()));
}
}