You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2009/11/15 09:06:33 UTC
svn commit: r836337 -
/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
Author: jbellis
Date: Sun Nov 15 08:06:32 2009
New Revision: 836337
URL: http://svn.apache.org/viewvc?rev=836337&view=rev
Log:
minor cleanup. patch by jbellis
Modified:
incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java?rev=836337&r1=836336&r2=836337&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java Sun Nov 15 08:06:32 2009
@@ -17,6 +17,7 @@
*/
package org.apache.cassandra.service;
+import java.io.IOError;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.TimeUnit;
@@ -169,13 +170,20 @@
// Get all the targets and stick them in an array
MessagingService.instance().sendRR(message, primaryNodes.toArray(new InetAddress[primaryNodes.size()]), quorumResponseHandler);
- if (!quorumResponseHandler.get())
- throw new UnavailableException();
+ try
+ {
+ if (!quorumResponseHandler.get())
+ throw new UnavailableException();
+ }
+ catch (DigestMismatchException e)
+ {
+ throw new AssertionError(e);
+ }
if (primaryNodes.size() < endpointMap.size()) // Do we need to bother with Hinted Handoff?
{
for (Map.Entry<InetAddress, InetAddress> e : endpointMap.entrySet())
{
- if (e.getKey() != e.getValue()) // Hinted Handoff to target
+ if (!e.getKey().equals(e.getValue())) // Hinted Handoff to target
{
MessagingService.instance().sendOneWay(message, e.getValue());
}
@@ -186,7 +194,7 @@
{
throw new UnavailableException();
}
- catch (Exception e)
+ catch (IOException e)
{
throw new RuntimeException("error writing key " + rm.key(), e);
}
@@ -300,7 +308,7 @@
* a specific set of column names from a given column family.
*/
public static List<Row> readProtocol(List<ReadCommand> commands, int consistency_level)
- throws IOException, TimeoutException, InvalidRequestException, UnavailableException
+ throws IOException, TimeoutException, UnavailableException
{
long startTime = System.currentTimeMillis();
@@ -449,7 +457,7 @@
* one of the other replicas (in the same data center if possible) till we get the data. In the event we get
* the data we perform consistency checks and figure out if any repairs need to be done to the replicas.
*/
- private static List<Row> weakReadLocal(List<ReadCommand> commands) throws IOException
+ private static List<Row> weakReadLocal(List<ReadCommand> commands)
{
List<Row> rows = new ArrayList<Row>();
List<Future<Object>> futures = new ArrayList<Future<Object>>();
@@ -569,7 +577,7 @@
{
endPoint = tokenMetadata.getSuccessor(endPoint); // TODO move this into the Strategies & modify for RackAwareStrategy
} while (!FailureDetector.instance().isAlive(endPoint));
- int maxResults = endPoint == wrapEndpoint ? rawCommand.maxResults : rawCommand.maxResults - allKeys.size();
+ int maxResults = endPoint.equals(wrapEndpoint) ? rawCommand.maxResults : rawCommand.maxResults - allKeys.size();
command = new RangeCommand(command.table, command.columnFamily, command.startWith, command.stopAt, maxResults);
} while (!endPoint.equals(startEndpoint));