Example usage for org.apache.cassandra.tools NodeProbe truncateHints

List of usage examples for org.apache.cassandra.tools NodeProbe truncateHints

Introduction

In this page you can find the example usage for org.apache.cassandra.tools NodeProbe truncateHints.

Prototype

public void truncateHints() 

Source Link

Usage

From source file:com.spotify.cassandra.opstools.TruncateHints.java

License:Apache License

public static void main(String[] args) throws IOException {
    if (args.length < 1) {
        System.out.println(String.format("Usage: %s [ALL | host [host ...]]", TruncateHints.class.getName()));
        System.exit(1);/* w w  w  .  j  av  a  2 s . c  o  m*/
    }

    NodeProbe nodeProbe = new NodeProbe(InetAddress.getLocalHost().getCanonicalHostName(), 7199);

    for (String arg : args) {
        if (arg.equals("ALL")) {
            nodeProbe.truncateHints();
        } else {
            nodeProbe.truncateHints(arg);
        }
    }

    System.out.println("Hints truncated!");
}