Author: jbellis
Date: Wed May 25 15:47:39 2011
New Revision: 1127569
URL: http://svn.apache.org/viewvc?rev=1127569&view=rev
Log:
clean up TruncateVerbHandler
Modified:
cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/TruncateVerbHandler.java
Modified:
cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/TruncateVerbHandler.java
URL:
http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/TruncateVerbHandler.java?rev=1127569&r1=1127568&r2=1127569&view=diff
==============================================================================
---
cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/TruncateVerbHandler.java
(original)
+++
cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/TruncateVerbHandler.java
Wed May 25 15:47:39 2011
@@ -20,6 +20,7 @@ package org.apache.cassandra.db;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
+import java.io.IOError;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
@@ -30,12 +31,6 @@ import org.apache.cassandra.net.IVerbHan
import org.apache.cassandra.net.Message;
import org.apache.cassandra.net.MessagingService;
-/**
- * Handles the TRUNCATE verb
- *
- * @author [email protected]
- *
- */
public class TruncateVerbHandler implements IVerbHandler
{
private static Logger logger =
LoggerFactory.getLogger(TruncateVerbHandler.class);
@@ -54,23 +49,10 @@ public class TruncateVerbHandler impleme
{
Table.open(t.keyspace).truncate(t.columnFamily);
}
- catch (IOException e)
+ catch (Exception e)
{
logger.error("Error in truncation", e);
respondError(t, message);
- throw e;
- }
- catch (InterruptedException e)
- {
- logger.error("Error in truncation", e);
- respondError(t, message);
- throw e;
- }
- catch (ExecutionException e)
- {
- logger.error("Error in truncation", e);
- respondError(t, message);
- throw e;
}
logger.debug("Truncate operation succeeded at this host");
@@ -81,18 +63,7 @@ public class TruncateVerbHandler impleme
}
catch (IOException e)
{
- logger.error("Error in truncation", e);
- throw new RuntimeException("Error in truncation", e);
- }
- catch (InterruptedException e)
- {
- logger.error("Error in truncation", e);
- throw new RuntimeException("Error in truncation", e);
- }
- catch (ExecutionException e)
- {
- logger.error("Error in truncation", e);
- throw new RuntimeException("Error in truncation", e);
+ throw new IOError(e);
}
}