Example usage for org.apache.cassandra.tools BootstrapMonitor BootstrapMonitor

List of usage examples for org.apache.cassandra.tools BootstrapMonitor BootstrapMonitor

Introduction

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

Prototype

public BootstrapMonitor(PrintStream out) 

Source Link

Usage

From source file:com.wenyu.utils.ClusterToolNodeProbe.java

License:Apache License

public void resumeBootstrap(PrintStream out) throws IOException {
    BootstrapMonitor monitor = new BootstrapMonitor(out);
    try {//from  w  w  w.  ja va2 s  . c  om
        jmxc.addConnectionNotificationListener(monitor, null, null);
        ssProxy.addNotificationListener(monitor, null, null);
        if (ssProxy.resumeBootstrap()) {
            out.println("Resuming bootstrap");
            monitor.awaitCompletion();
        } else {
            out.println("Node is already bootstrapped.");
        }
    } catch (Exception e) {
        throw new IOException(e);
    } finally {
        try {
            ssProxy.removeNotificationListener(monitor);
            jmxc.removeConnectionNotificationListener(monitor);
        } catch (Throwable e) {
            out.println("Exception occurred during clean-up. " + e);
        }
    }
}