ctubbsii commented on a change in pull request #337: ACCUMULO-4732 No APIs to 
configure iterators or locality groups for new tables
URL: https://github.com/apache/accumulo/pull/337#discussion_r157079646
 
 

 ##########
 File path: 
core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
 ##########
 @@ -340,4 +340,14 @@ public static void seek(FileSKVIterator reader, Range 
range, String lgName, Map<
 
     reader.seek(range, families, inclusive);
   }
+
+  static public void ensureNonOverlappingGroups(Map<String,Set<Text>> groups) {
+    HashSet<Text> all = new HashSet<>();
+    for (Entry<String,Set<Text>> entry : groups.entrySet()) {
+      if (!Collections.disjoint(all, entry.getValue())) {
+        throw new IllegalArgumentException("Group " + entry.getKey() + " 
overlaps with another group");
+      }
+      all.addAll(entry.getValue());
+    }
+  }
 
 Review comment:
   This location would make this public API... but I'm not sure we want to do 
that for an internal utility method.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to