accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [2/4] accumulo git commit: ACCUMULO-4353 Avoid fallthrough compiler warning
Date Mon, 25 Jul 2016 21:09:54 GMT
ACCUMULO-4353 Avoid fallthrough compiler warning

Avoid a newly introduced switch case fallthrough warning from the Java
compiler with an explicit method call for the common functionality.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/74507ae3
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/74507ae3
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/74507ae3

Branch: refs/heads/master
Commit: 74507ae3a3da7b7cce5dda634163a6030ad79ac3
Parents: 2a373da
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Mon Jul 25 16:21:04 2016 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Mon Jul 25 16:22:26 2016 -0400

----------------------------------------------------------------------
 .../apache/accumulo/master/TabletGroupWatcher.java | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/74507ae3/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java
b/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java
index 76fda21..3f7dc74 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java
@@ -322,13 +322,10 @@ abstract class TabletGroupWatcher extends Daemon {
               case SUSPENDED:
                 // Request a move to UNASSIGNED, so as to allow balancing to continue.
                 suspendedToGoneServers.add(tls);
-                // Fall through to unassigned to cancel migrations.
+                cancelOfflineTableMigrations(tls);
+                break;
               case UNASSIGNED:
-                TServerInstance dest = this.master.migrations.get(tls.extent);
-                TableState tableState = TableManager.getInstance().getTableState(tls.extent.getTableId());
-                if (dest != null && tableState == TableState.OFFLINE) {
-                  this.master.migrations.remove(tls.extent);
-                }
+                cancelOfflineTableMigrations(tls);
                 break;
               case ASSIGNED_TO_DEAD_SERVER:
                 assignedToDeadServers.add(tls);
@@ -401,6 +398,14 @@ abstract class TabletGroupWatcher extends Daemon {
     }
   }
 
+  private void cancelOfflineTableMigrations(TabletLocationState tls) {
+    TServerInstance dest = this.master.migrations.get(tls.extent);
+    TableState tableState = TableManager.getInstance().getTableState(tls.extent.getTableId());
+    if (dest != null && tableState == TableState.OFFLINE) {
+      this.master.migrations.remove(tls.extent);
+    }
+  }
+
   private void repairMetadata(Text row) {
     Master.log.debug("Attempting repair on " + row);
     // ACCUMULO-2261 if a dying tserver writes a location before its lock information propagates,
it may cause duplicate assignment.


Mime
View raw message