cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [1/2] git commit: semi-ninja trivial IOE cleanup
Date Wed, 03 Apr 2013 23:13:54 GMT
Updated Branches:
  refs/heads/trunk e306a87b7 -> 273924847


semi-ninja trivial IOE cleanup

patch by Aleksey Yeschenko; reviewed by Brandon Williams


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/6a03b110
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/6a03b110
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/6a03b110

Branch: refs/heads/trunk
Commit: 6a03b1103513bffbf8bc4dacb5abb6b5b3726e37
Parents: 5a43c39
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Thu Apr 4 01:54:48 2013 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Thu Apr 4 01:54:48 2013 +0300

----------------------------------------------------------------------
 .../org/apache/cassandra/cql/QueryProcessor.java   |   33 +++--------
 .../cql3/statements/ModificationStatement.java     |   45 ++++++---------
 .../cassandra/cql3/statements/SelectStatement.java |   25 ++-------
 .../org/apache/cassandra/db/CounterMutation.java   |    2 +-
 src/java/org/apache/cassandra/db/ReadCommand.java  |    2 +-
 .../org/apache/cassandra/db/ReadVerbHandler.java   |   25 +++------
 .../cassandra/db/RetriedSliceFromReadCommand.java  |    6 --
 .../cassandra/db/SliceByNamesReadCommand.java      |    2 +-
 .../cassandra/service/IResponseResolver.java       |    6 +-
 .../service/RangeSliceResponseResolver.java        |    5 +-
 .../org/apache/cassandra/service/ReadCallback.java |   10 +--
 .../apache/cassandra/service/RowDataResolver.java  |    7 +--
 .../cassandra/service/RowDigestResolver.java       |    5 +-
 .../org/apache/cassandra/service/StorageProxy.java |   10 ++--
 .../apache/cassandra/thrift/CassandraServer.java   |   17 ------
 15 files changed, 59 insertions(+), 141 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a03b110/src/java/org/apache/cassandra/cql/QueryProcessor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql/QueryProcessor.java b/src/java/org/apache/cassandra/cql/QueryProcessor.java
index 01e5ba3..5977301 100644
--- a/src/java/org/apache/cassandra/cql/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql/QueryProcessor.java
@@ -116,14 +116,7 @@ public class QueryProcessor
             }
         }
 
-        try
-        {
-            return StorageProxy.read(commands, select.getConsistencyLevel());
-        }
-        catch (IOException e)
-        {
-            throw new RuntimeException(e);
-        }
+        return StorageProxy.read(commands, select.getConsistencyLevel());
     }
 
     private static SortedSet<ByteBuffer> getColumnNames(SelectStatement select, CFMetaData
metadata, List<ByteBuffer> variables)
@@ -144,7 +137,6 @@ public class QueryProcessor
     private static List<org.apache.cassandra.db.Row> multiRangeSlice(CFMetaData metadata,
SelectStatement select, List<ByteBuffer> variables)
     throws ReadTimeoutException, UnavailableException, InvalidRequestException
     {
-        List<org.apache.cassandra.db.Row> rows;
         IPartitioner<?> p = StorageService.getPartitioner();
 
         AbstractType<?> keyType = Schema.instance.getCFMetaData(metadata.ksName, select.getColumnFamily()).getKeyValidator();
@@ -187,21 +179,14 @@ public class QueryProcessor
                   ? select.getNumRecords() + 1
                   : select.getNumRecords();
 
-        try
-        {
-            rows = StorageProxy.getRangeSlice(new RangeSliceCommand(metadata.ksName,
-                                                                    select.getColumnFamily(),
-                                                                    null,
-                                                                    columnFilter,
-                                                                    bounds,
-                                                                    expressions,
-                                                                    limit),
-                                                                    select.getConsistencyLevel());
-        }
-        catch (IOException e)
-        {
-            throw new RuntimeException(e);
-        }
+        List<org.apache.cassandra.db.Row> rows = StorageProxy.getRangeSlice(new RangeSliceCommand(metadata.ksName,
+                                                                                        
         select.getColumnFamily(),
+                                                                                        
         null,
+                                                                                        
         columnFilter,
+                                                                                        
         bounds,
+                                                                                        
         expressions,
+                                                                                        
         limit),
+                                                                            select.getConsistencyLevel());
 
         // if start key was set and relation was "greater than"
         if (select.getKeyStart() != null && !select.includeStartKey() &&
!rows.isEmpty())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a03b110/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
index 4af27ba..28a003e 100644
--- a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
@@ -17,8 +17,6 @@
  */
 package org.apache.cassandra.cql3.statements;
 
-import java.io.IOError;
-import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.*;
 
@@ -168,33 +166,26 @@ public abstract class ModificationStatement extends CFStatement implements
CQLSt
                                                   new QueryPath(columnFamily()),
                                                   new SliceQueryFilter(slices, false, Integer.MAX_VALUE)));
 
-        try
-        {
-            List<Row> rows = local
-                           ? SelectStatement.readLocally(keyspace(), commands)
-                           : StorageProxy.read(commands, cl);
-
-            Map<ByteBuffer, ColumnGroupMap> map = new HashMap<ByteBuffer, ColumnGroupMap>();
-            for (Row row : rows)
-            {
-                if (row.cf == null || row.cf.isEmpty())
-                    continue;
-
-                ColumnGroupMap.Builder groupBuilder = new ColumnGroupMap.Builder(composite,
true);
-                for (IColumn column : row.cf)
-                    groupBuilder.add(column);
-
-                List<ColumnGroupMap> groups = groupBuilder.groups();
-                assert groups.isEmpty() || groups.size() == 1;
-                if (!groups.isEmpty())
-                    map.put(row.key.key, groups.get(0));
-            }
-            return map;
-        }
-        catch (IOException e)
+        List<Row> rows = local
+                       ? SelectStatement.readLocally(keyspace(), commands)
+                       : StorageProxy.read(commands, cl);
+
+        Map<ByteBuffer, ColumnGroupMap> map = new HashMap<ByteBuffer, ColumnGroupMap>();
+        for (Row row : rows)
         {
-            throw new IOError(e);
+            if (row.cf == null || row.cf.isEmpty())
+                continue;
+
+            ColumnGroupMap.Builder groupBuilder = new ColumnGroupMap.Builder(composite, true);
+            for (IColumn column : row.cf)
+                groupBuilder.add(column);
+
+            List<ColumnGroupMap> groups = groupBuilder.groups();
+            assert groups.isEmpty() || groups.size() == 1;
+            if (!groups.isEmpty())
+                map.put(row.key.key, groups.get(0));
         }
+        return map;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a03b110/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index fc8842f..3e14923 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -17,7 +17,6 @@
  */
 package org.apache.cassandra.cql3.statements;
 
-import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.*;
 import java.util.concurrent.ExecutionException;
@@ -31,9 +30,7 @@ import org.apache.cassandra.cql3.*;
 import org.apache.cassandra.transport.messages.ResultMessage;
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.ColumnDefinition;
-import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.db.*;
-import org.apache.cassandra.db.context.CounterContext;
 import org.apache.cassandra.db.filter.*;
 import org.apache.cassandra.db.index.SecondaryIndex;
 import org.apache.cassandra.db.index.SecondaryIndexManager;
@@ -52,7 +49,6 @@ import org.apache.cassandra.thrift.ThriftValidation;
 import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.Pair;
-import org.apache.cassandra.utils.UUIDGen;
 
 /**
  * Encapsulates a completely parsed SELECT query, including the target
@@ -127,18 +123,11 @@ public class SelectStatement implements CQLStatement
 
         cl.validateForRead(keyspace());
 
-        try
-        {
-            List<Row> rows = isKeyRange
-                           ? StorageProxy.getRangeSlice(getRangeCommand(variables), cl)
-                           : StorageProxy.read(getSliceCommands(variables), cl);
+        List<Row> rows = isKeyRange
+                       ? StorageProxy.getRangeSlice(getRangeCommand(variables), cl)
+                       : StorageProxy.read(getSliceCommands(variables), cl);
 
-            return processResults(rows, variables);
-        }
-        catch (IOException e)
-        {
-            throw new RuntimeException(e);
-        }
+        return processResults(rows, variables);
     }
 
     private ResultMessage.Rows processResults(List<Row> rows, List<ByteBuffer>
variables) throws RequestValidationException
@@ -149,7 +138,7 @@ public class SelectStatement implements CQLStatement
         return new ResultMessage.Rows(rset);
     }
 
-    static List<Row> readLocally(String keyspace, List<ReadCommand> cmds) throws
IOException
+    static List<Row> readLocally(String keyspace, List<ReadCommand> cmds)
     {
         Table table = Table.open(keyspace);
         List<Row> rows = new ArrayList(cmds.size());
@@ -168,10 +157,6 @@ public class SelectStatement implements CQLStatement
 
             return processResults(rows, Collections.<ByteBuffer>emptyList());
         }
-        catch (IOException e)
-        {
-            throw new RuntimeException(e);
-        }
         catch (ExecutionException e)
         {
             throw new RuntimeException(e);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a03b110/src/java/org/apache/cassandra/db/CounterMutation.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/CounterMutation.java b/src/java/org/apache/cassandra/db/CounterMutation.java
index d06df33..62ea3f7 100644
--- a/src/java/org/apache/cassandra/db/CounterMutation.java
+++ b/src/java/org/apache/cassandra/db/CounterMutation.java
@@ -72,7 +72,7 @@ public class CounterMutation implements IMutation
         return consistency;
     }
 
-    public RowMutation makeReplicationMutation() throws IOException
+    public RowMutation makeReplicationMutation()
     {
         List<ReadCommand> readCommands = new LinkedList<ReadCommand>();
         for (ColumnFamily columnFamily : rowMutation.getColumnFamilies())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a03b110/src/java/org/apache/cassandra/db/ReadCommand.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ReadCommand.java b/src/java/org/apache/cassandra/db/ReadCommand.java
index 6c364cb..27cd1c9 100644
--- a/src/java/org/apache/cassandra/db/ReadCommand.java
+++ b/src/java/org/apache/cassandra/db/ReadCommand.java
@@ -79,7 +79,7 @@ public abstract class ReadCommand implements IReadCommand
 
     public abstract ReadCommand copy();
 
-    public abstract Row getRow(Table table) throws IOException;
+    public abstract Row getRow(Table table);
 
     public abstract IDiskAtomFilter filter();
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a03b110/src/java/org/apache/cassandra/db/ReadVerbHandler.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ReadVerbHandler.java b/src/java/org/apache/cassandra/db/ReadVerbHandler.java
index fbd4f9b..a06035a 100644
--- a/src/java/org/apache/cassandra/db/ReadVerbHandler.java
+++ b/src/java/org/apache/cassandra/db/ReadVerbHandler.java
@@ -17,8 +17,6 @@
  */
 package org.apache.cassandra.db;
 
-import java.io.IOException;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -41,22 +39,15 @@ public class ReadVerbHandler implements IVerbHandler<ReadCommand>
             throw new RuntimeException("Cannot service reads while bootstrapping!");
         }
 
-        try
-        {
-            ReadCommand command = message.payload;
-            Table table = Table.open(command.table);
-            Row row = command.getRow(table);
+        ReadCommand command = message.payload;
+        Table table = Table.open(command.table);
+        Row row = command.getRow(table);
 
-            MessageOut<ReadResponse> reply = new MessageOut<ReadResponse>(MessagingService.Verb.REQUEST_RESPONSE,
-                                                                          getResponse(command,
row),
-                                                                          ReadResponse.serializer);
-            Tracing.trace("Enqueuing response to {}", message.from);
-            MessagingService.instance().sendReply(reply, id, message.from);
-        }
-        catch (IOException ex)
-        {
-            throw new RuntimeException(ex);
-        }
+        MessageOut<ReadResponse> reply = new MessageOut<ReadResponse>(MessagingService.Verb.REQUEST_RESPONSE,
+                                                                      getResponse(command,
row),
+                                                                      ReadResponse.serializer);
+        Tracing.trace("Enqueuing response to {}", message.from);
+        MessagingService.instance().sendReply(reply, id, message.from);
     }
 
     public static ReadResponse getResponse(ReadCommand command, Row row)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a03b110/src/java/org/apache/cassandra/db/RetriedSliceFromReadCommand.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/RetriedSliceFromReadCommand.java b/src/java/org/apache/cassandra/db/RetriedSliceFromReadCommand.java
index e7e99fe..8a8f8c6 100644
--- a/src/java/org/apache/cassandra/db/RetriedSliceFromReadCommand.java
+++ b/src/java/org/apache/cassandra/db/RetriedSliceFromReadCommand.java
@@ -20,7 +20,6 @@ package org.apache.cassandra.db;
 import java.nio.ByteBuffer;
 
 import org.apache.cassandra.db.filter.*;
-import org.apache.cassandra.thrift.ColumnParent;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -29,11 +28,6 @@ public class RetriedSliceFromReadCommand extends SliceFromReadCommand
     static final Logger logger = LoggerFactory.getLogger(RetriedSliceFromReadCommand.class);
     public final int originalCount;
 
-    public RetriedSliceFromReadCommand(String table, ByteBuffer key, ColumnParent column_parent,
SliceQueryFilter filter, int originalCount)
-    {
-        this(table, key, new QueryPath(column_parent), filter, originalCount);
-    }
-
     public RetriedSliceFromReadCommand(String table, ByteBuffer key, QueryPath path, SliceQueryFilter
filter, int originalCount)
     {
         super(table, key, path, filter);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a03b110/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java b/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java
index 2b3b0b1..bb3b7b9 100644
--- a/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java
+++ b/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java
@@ -58,7 +58,7 @@ public class SliceByNamesReadCommand extends ReadCommand
         return readCommand;
     }
 
-    public Row getRow(Table table) throws IOException
+    public Row getRow(Table table)
     {
         DecoratedKey dk = StorageService.getPartitioner().decorateKey(key);
         return table.getRow(new QueryFilter(dk, queryPath, filter));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a03b110/src/java/org/apache/cassandra/service/IResponseResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/IResponseResolver.java b/src/java/org/apache/cassandra/service/IResponseResolver.java
index 4ac226f..17c8bff 100644
--- a/src/java/org/apache/cassandra/service/IResponseResolver.java
+++ b/src/java/org/apache/cassandra/service/IResponseResolver.java
@@ -17,8 +17,6 @@
  */
 package org.apache.cassandra.service;
 
-import java.io.IOException;
-
 import org.apache.cassandra.net.MessageIn;
 
 public interface IResponseResolver<TMessage, TResolved> {
@@ -31,14 +29,14 @@ public interface IResponseResolver<TMessage, TResolved> {
      * repairs . Hence you need to derive a response resolver based on your
      * needs from this interface.
      */
-    public TResolved resolve() throws DigestMismatchException, IOException;
+    public TResolved resolve() throws DigestMismatchException;
 
     public boolean isDataPresent();
 
     /**
      * returns the data response without comparing with any digests
      */
-    public TResolved getData() throws IOException;
+    public TResolved getData();
 
     public void preprocess(MessageIn<TMessage> message);
     public Iterable<MessageIn<TMessage>> getMessages();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a03b110/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java b/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java
index 1dfd01e..99e3fc3 100644
--- a/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java
+++ b/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java
@@ -17,7 +17,6 @@
  */
 package org.apache.cassandra.service;
 
-import java.io.IOException;
 import java.net.InetAddress;
 import java.util.*;
 import java.util.concurrent.LinkedBlockingQueue;
@@ -59,7 +58,7 @@ public class RangeSliceResponseResolver implements IResponseResolver<RangeSliceR
         this.sources = endpoints;
     }
 
-    public List<Row> getData() throws IOException
+    public List<Row> getData()
     {
         MessageIn<RangeSliceReply> response = responses.iterator().next();
         return response.payload.rows;
@@ -67,7 +66,7 @@ public class RangeSliceResponseResolver implements IResponseResolver<RangeSliceR
 
     // Note: this would deserialize the response a 2nd time if getData was called first.
     // (this is not currently an issue since we don't do read repair for range queries.)
-    public Iterable<Row> resolve() throws IOException
+    public Iterable<Row> resolve()
     {
         ArrayList<RowIterator> iters = new ArrayList<RowIterator>(responses.size());
         int n = 0;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a03b110/src/java/org/apache/cassandra/service/ReadCallback.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/ReadCallback.java b/src/java/org/apache/cassandra/service/ReadCallback.java
index f1ca96e..a19df5f 100644
--- a/src/java/org/apache/cassandra/service/ReadCallback.java
+++ b/src/java/org/apache/cassandra/service/ReadCallback.java
@@ -17,21 +17,18 @@
  */
 package org.apache.cassandra.service;
 
-import java.io.IOException;
 import java.net.InetAddress;
 import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.cassandra.config.Schema;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.concurrent.Stage;
 import org.apache.cassandra.concurrent.StageManager;
-import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.db.ReadCommand;
 import org.apache.cassandra.db.Table;
@@ -44,7 +41,6 @@ import org.apache.cassandra.net.MessagingService;
 import org.apache.cassandra.db.ConsistencyLevel;
 import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.SimpleCondition;
-import org.apache.cassandra.utils.WrappedRunnable;
 
 public class ReadCallback<TMessage, TResolved> implements IAsyncCallback<TMessage>
 {
@@ -86,7 +82,7 @@ public class ReadCallback<TMessage, TResolved> implements IAsyncCallback<TMessag
         return new ReadCallback(newResolver, consistencyLevel, blockfor, command, table,
endpoints);
     }
 
-    public TResolved get() throws ReadTimeoutException, DigestMismatchException, IOException
+    public TResolved get() throws ReadTimeoutException, DigestMismatchException
     {
         long timeout = command.getTimeout() - (System.currentTimeMillis() - startTime);
         boolean success;
@@ -161,9 +157,9 @@ public class ReadCallback<TMessage, TResolved> implements IAsyncCallback<TMessag
         return true;
     }
 
-    private class AsyncRepairRunner extends WrappedRunnable
+    private class AsyncRepairRunner implements Runnable
     {
-        protected void runMayThrow() throws IOException
+        public void run()
         {
             // If the resolver is a RowDigestResolver, we need to do a full data read if
there is a mismatch.
             // Otherwise, resolve will send the repairs directly if needs be (and in that
case we should never

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a03b110/src/java/org/apache/cassandra/service/RowDataResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/RowDataResolver.java b/src/java/org/apache/cassandra/service/RowDataResolver.java
index 5545293..495d115 100644
--- a/src/java/org/apache/cassandra/service/RowDataResolver.java
+++ b/src/java/org/apache/cassandra/service/RowDataResolver.java
@@ -17,7 +17,6 @@
  */
 package org.apache.cassandra.service;
 
-import java.io.IOException;
 import java.net.InetAddress;
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
@@ -31,14 +30,12 @@ import org.apache.cassandra.db.columniterator.IdentityQueryFilter;
 import org.apache.cassandra.db.filter.IDiskAtomFilter;
 import org.apache.cassandra.db.filter.QueryFilter;
 import org.apache.cassandra.db.filter.QueryPath;
-import org.apache.cassandra.db.filter.SliceQueryFilter;
 import org.apache.cassandra.net.IAsyncResult;
 import org.apache.cassandra.net.MessageIn;
 import org.apache.cassandra.net.MessageOut;
 import org.apache.cassandra.net.MessagingService;
 import org.apache.cassandra.utils.CloseableIterator;
 import org.apache.cassandra.utils.FBUtilities;
-import org.apache.cassandra.utils.IFilter;
 
 public class RowDataResolver extends AbstractRowResolver
 {
@@ -59,7 +56,7 @@ public class RowDataResolver extends AbstractRowResolver
     * as full data reads.  In this case we need to compute the most recent version
     * of each column, and send diffs to out-of-date replicas.
     */
-    public Row resolve() throws DigestMismatchException, IOException
+    public Row resolve() throws DigestMismatchException
     {
         if (logger.isDebugEnabled())
             logger.debug("resolving " + replies.size() + " responses");
@@ -165,7 +162,7 @@ public class RowDataResolver extends AbstractRowResolver
         return ColumnFamilyStore.removeDeleted(resolved, Integer.MIN_VALUE);
     }
 
-    public Row getData() throws IOException
+    public Row getData()
     {
         return replies.iterator().next().payload.row();
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a03b110/src/java/org/apache/cassandra/service/RowDigestResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/RowDigestResolver.java b/src/java/org/apache/cassandra/service/RowDigestResolver.java
index eeccbeb..3f31a44 100644
--- a/src/java/org/apache/cassandra/service/RowDigestResolver.java
+++ b/src/java/org/apache/cassandra/service/RowDigestResolver.java
@@ -17,7 +17,6 @@
  */
 package org.apache.cassandra.service;
 
-import java.io.IOException;
 import java.nio.ByteBuffer;
 
 import org.apache.cassandra.db.ColumnFamily;
@@ -35,7 +34,7 @@ public class RowDigestResolver extends AbstractRowResolver
     /**
      * Special case of resolve() so that CL.ONE reads never throw DigestMismatchException
in the foreground
      */
-    public Row getData() throws IOException
+    public Row getData()
     {
         for (MessageIn<ReadResponse> message : replies)
         {
@@ -57,7 +56,7 @@ public class RowDigestResolver extends AbstractRowResolver
      * b) we're checking additional digests that arrived after the minimum to handle
      *    the requested ConsistencyLevel, i.e. asynchronous read repair check
      */
-    public Row resolve() throws DigestMismatchException, IOException
+    public Row resolve() throws DigestMismatchException
     {
         if (logger.isDebugEnabled())
             logger.debug("resolving " + replies.size() + " responses");

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a03b110/src/java/org/apache/cassandra/service/StorageProxy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageProxy.java b/src/java/org/apache/cassandra/service/StorageProxy.java
index 272c52b..b9cce15 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -790,7 +790,7 @@ public class StorageProxy implements StorageProxyMBean
                     // and we want to avoid blocking too much the MUTATION stage
                     StageManager.getStage(Stage.REPLICATE_ON_WRITE).execute(new DroppableRunnable(MessagingService.Verb.READ)
                     {
-                        public void runMayThrow() throws IOException, OverloadedException
+                        public void runMayThrow() throws OverloadedException
                         {
                             // send mutation to other replica
                             sendToHintedEndpoints(cm.makeReplicationMutation(), remotes,
responseHandler, localDataCenter, consistency_level);
@@ -814,7 +814,7 @@ public class StorageProxy implements StorageProxyMBean
      * a specific set of column names from a given column family.
      */
     public static List<Row> read(List<ReadCommand> commands, ConsistencyLevel
consistency_level)
-    throws IOException, UnavailableException, IsBootstrappingException, ReadTimeoutException
+    throws UnavailableException, IsBootstrappingException, ReadTimeoutException
     {
         if (StorageService.instance.isBootstrapMode() && !systemTableQuery(commands))
         {
@@ -859,7 +859,7 @@ public class StorageProxy implements StorageProxyMBean
      * 5. else carry out read repair by getting data from all the nodes.
      */
     private static List<Row> fetchRows(List<ReadCommand> initialCommands, ConsistencyLevel
consistency_level)
-    throws IOException, UnavailableException, ReadTimeoutException
+    throws UnavailableException, ReadTimeoutException
     {
         List<Row> rows = new ArrayList<Row>(initialCommands.size());
         List<ReadCommand> commandsToRetry = Collections.emptyList();
@@ -1044,7 +1044,7 @@ public class StorageProxy implements StorageProxyMBean
             this.handler = handler;
         }
 
-        protected void runMayThrow() throws IOException
+        protected void runMayThrow()
         {
             logger.trace("LocalReadRunnable reading {}", command);
 
@@ -1104,7 +1104,7 @@ public class StorageProxy implements StorageProxyMBean
     }
 
     public static List<Row> getRangeSlice(RangeSliceCommand command, ConsistencyLevel
consistency_level)
-    throws IOException, UnavailableException, ReadTimeoutException
+    throws UnavailableException, ReadTimeoutException
     {
         Tracing.trace("Determining replicas to query");
         logger.trace("Command/ConsistencyLevel is {}/{}", command.toString(), consistency_level);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a03b110/src/java/org/apache/cassandra/thrift/CassandraServer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java
index 7002436..dc74f57 100644
--- a/src/java/org/apache/cassandra/thrift/CassandraServer.java
+++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java
@@ -52,7 +52,6 @@ import org.apache.cassandra.exceptions.RequestExecutionException;
 import org.apache.cassandra.exceptions.RequestValidationException;
 import org.apache.cassandra.exceptions.UnauthorizedException;
 import org.apache.cassandra.io.util.DataOutputBuffer;
-import org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.locator.DynamicEndpointSnitch;
 import org.apache.cassandra.scheduler.IRequestScheduler;
 import org.apache.cassandra.service.*;
@@ -111,10 +110,6 @@ public class CassandraServer implements Cassandra.Iface
         {
             ThriftConversion.rethrow(e);
         }
-        catch (IOException e)
-        {
-            throw new RuntimeException(e);
-        }
 
         for (Row row: rows)
         {
@@ -977,10 +972,6 @@ public class CassandraServer implements Cassandra.Iface
         {
             throw ThriftConversion.toThrift(e);
         }
-        catch (IOException e)
-        {
-            throw new RuntimeException(e);
-        }
         finally
         {
             Tracing.instance().stopSession();
@@ -1065,10 +1056,6 @@ public class CassandraServer implements Cassandra.Iface
         {
             throw ThriftConversion.toThrift(e);
         }
-        catch (IOException e)
-        {
-            throw new RuntimeException(e);
-        }
         finally
         {
             Tracing.instance().stopSession();
@@ -1145,10 +1132,6 @@ public class CassandraServer implements Cassandra.Iface
         {
             throw ThriftConversion.toThrift(e);
         }
-        catch (IOException e)
-        {
-            throw new RuntimeException(e);
-        }
         finally
         {
             Tracing.instance().stopSession();


Mime
View raw message