Search in sources :

Example 1 with TruncateException

use of org.apache.cassandra.exceptions.TruncateException in project cassandra by apache.

the class TruncateResponseHandler method get.

public void get() throws TimeoutException {
    long timeoutNanos = getTruncateRpcTimeout(NANOSECONDS) - (nanoTime() - start);
    boolean completedInTime;
    try {
        // TODO truncate needs a much longer timeout
        completedInTime = condition.await(timeoutNanos, NANOSECONDS);
    } catch (InterruptedException e) {
        throw new UncheckedInterruptedException(e);
    }
    if (!completedInTime) {
        throw new TimeoutException("Truncate timed out - received only " + responses.get() + " responses");
    }
    if (truncateFailingReplica != null) {
        throw new TruncateException("Truncate failed on replica " + truncateFailingReplica);
    }
}
Also used : TruncateException(org.apache.cassandra.exceptions.TruncateException) UncheckedInterruptedException(org.apache.cassandra.utils.concurrent.UncheckedInterruptedException) UncheckedInterruptedException(org.apache.cassandra.utils.concurrent.UncheckedInterruptedException) TimeoutException(java.util.concurrent.TimeoutException)

Aggregations

TimeoutException (java.util.concurrent.TimeoutException)1 TruncateException (org.apache.cassandra.exceptions.TruncateException)1 UncheckedInterruptedException (org.apache.cassandra.utils.concurrent.UncheckedInterruptedException)1