cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [1/3] git commit: Move misplaced try catch block
Date Mon, 10 Mar 2014 15:30:53 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 7bc4f5dc3 -> 639ddace4
  refs/heads/trunk 14c2c3bbe -> e185afab6


Move misplaced try catch block

ActiveRepairService#getNeighbors can throw IllegalArgumentException,
not forceKeyspaceRepair.


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

Branch: refs/heads/cassandra-2.1
Commit: 639ddace4d314919650459ed2065ea8e73ed3e2e
Parents: 7bc4f5d
Author: Yuki Morishita <yukim@apache.org>
Authored: Mon Mar 10 10:29:10 2014 -0500
Committer: Yuki Morishita <yukim@apache.org>
Committed: Mon Mar 10 10:29:10 2014 -0500

----------------------------------------------------------------------
 .../cassandra/service/StorageService.java       | 27 ++++++++++----------
 1 file changed, 13 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/639ddace/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index d1db703..0d5cef0 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -2581,9 +2581,18 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
                 Map<Range, Set<InetAddress>> rangeToNeighbors = new HashMap<>();
                 for (Range<Token> range : ranges)
                 {
-                    Set<InetAddress> neighbors = ActiveRepairService.getNeighbors(keyspace,
range, dataCenters, hosts);
-                    rangeToNeighbors.put(range, neighbors);
-                    allNeighbors.addAll(neighbors);
+                    try
+                    {
+                        Set<InetAddress> neighbors = ActiveRepairService.getNeighbors(keyspace,
range, dataCenters, hosts);
+                        rangeToNeighbors.put(range, neighbors);
+                        allNeighbors.addAll(neighbors);
+                    }
+                    catch (IllegalArgumentException e)
+                    {
+                        logger.error("Repair failed:", e);
+                        sendNotification("repair", message, new int[]{cmd, ActiveRepairService.Status.FINISHED.ordinal()});
+                        return;
+                    }
                 }
 
                 List<ColumnFamilyStore> columnFamilyStores = new ArrayList<>();
@@ -2597,17 +2606,7 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
                 List<RepairFuture> futures = new ArrayList<>(ranges.size());
                 for (Range<Token> range : ranges)
                 {
-                    RepairFuture future;
-                    try
-                    {
-                        future = forceKeyspaceRepair(parentSession, range, keyspace, isSequential,
rangeToNeighbors.get(range), columnFamilies);
-                    }
-                    catch (IllegalArgumentException e)
-                    {
-                        logger.error("Repair session failed:", e);
-                        sendNotification("repair", message, new int[]{cmd, ActiveRepairService.Status.SESSION_FAILED.ordinal()});
-                        continue;
-                    }
+                    RepairFuture future = forceKeyspaceRepair(parentSession, range, keyspace,
isSequential, rangeToNeighbors.get(range), columnFamilies);
                     if (future == null)
                         continue;
                     futures.add(future);


Mime
View raw message