accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmil...@apache.org
Subject accumulo git commit: ACCUMULO-4662 Replace string with Table.ID
Date Tue, 22 Aug 2017 16:35:06 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master b6a211145 -> d63181a06


ACCUMULO-4662 Replace string with Table.ID


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

Branch: refs/heads/master
Commit: d63181a0695d604c78d6cf43ca23a3cf25a1d4f0
Parents: b6a2111
Author: Mike Miller <mmiller@apache.org>
Authored: Fri Aug 18 17:09:32 2017 -0400
Committer: Mike Miller <mmiller@apache.org>
Committed: Tue Aug 22 11:47:04 2017 -0400

----------------------------------------------------------------------
 .../master/state/TabletStateChangeIterator.java     | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/d63181a0/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
b/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
index 8f372b3..56e2834 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
@@ -58,7 +58,7 @@ public class TabletStateChangeIterator extends SkippingIterator {
   private static final Logger log = LoggerFactory.getLogger(TabletStateChangeIterator.class);
 
   private Set<TServerInstance> current;
-  private Set<String> onlineTables;
+  private Set<Table.ID> onlineTables;
   private Map<Table.ID,MergeInfo> merges;
   private boolean debug = false;
   private Set<KeyExtent> migrations;
@@ -68,7 +68,7 @@ public class TabletStateChangeIterator extends SkippingIterator {
   public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String>
options, IteratorEnvironment env) throws IOException {
     super.init(source, options, env);
     current = parseServers(options.get(SERVERS_OPTION));
-    onlineTables = parseTables(options.get(TABLES_OPTION));
+    onlineTables = parseTableIDs(options.get(TABLES_OPTION));
     merges = parseMerges(options.get(MERGES_OPTION));
     debug = options.containsKey(DEBUG_OPTION);
     migrations = parseMigrations(options.get(MIGRATIONS_OPTION));
@@ -104,12 +104,12 @@ public class TabletStateChangeIterator extends SkippingIterator {
     }
   }
 
-  private Set<String> parseTables(String tables) {
-    if (tables == null)
+  private Set<Table.ID> parseTableIDs(String tableIDs) {
+    if (tableIDs == null)
       return null;
-    Set<String> result = new HashSet<>();
-    for (String table : tables.split(","))
-      result.add(table);
+    Set<Table.ID> result = new HashSet<>();
+    for (String tableID : tableIDs.split(","))
+      result.add(Table.ID.of(tableID));
     return result;
   }
 
@@ -180,7 +180,7 @@ public class TabletStateChangeIterator extends SkippingIterator {
       }
 
       // is the table supposed to be online or offline?
-      boolean shouldBeOnline = onlineTables.contains(tls.extent.getTableId().canonicalID());
+      boolean shouldBeOnline = onlineTables.contains(tls.extent.getTableId());
 
       if (debug) {
         log.debug(tls.extent + " is " + tls.getState(current) + " and should be " + (shouldBeOnline
? "on" : "off") + "line");


Mime
View raw message