Example usage for org.apache.cassandra.service StorageProxy truncateBlocking

List of usage examples for org.apache.cassandra.service StorageProxy truncateBlocking

Introduction

In this page you can find the example usage for org.apache.cassandra.service StorageProxy truncateBlocking.

Prototype

public static void truncateBlocking(String keyspace, String cfname)
        throws UnavailableException, TimeoutException 

Source Link

Document

Performs the truncate operatoin, which effectively deletes all data from the column family cfname

Usage

From source file:org.usergrid.vx.experimental.CassandraRunner.java

License:Apache License

private void maybeTruncateSafely(RequiresColumnFamily rcf) {
    if (rcf != null && rcf.truncateExisting()) {
        try {/*  w  ww. ja  v a2  s.  com*/
            StorageProxy.truncateBlocking(rcf.ksName(), rcf.cfName());
        } catch (Exception ex) {
            throw new RuntimeException("Could not truncate column family: " + rcf.cfName(), ex);
        }
    }
}