dlmarion commented on code in PR #3091:
URL: https://github.com/apache/accumulo/pull/3091#discussion_r1033939311


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchReaderIterator.java:
##########
@@ -241,38 +247,59 @@ private void binRanges(TabletLocator tabletLocator, 
List<Range> ranges,
 
     int lastFailureSize = Integer.MAX_VALUE;
 
-    while (true) {
+    if (options.getConsistencyLevel().equals(ConsistencyLevel.EVENTUAL) && 
!this.tableOnline) {
 
+      // The TabletLocator only caches the location of tablets for online 
tables. The ScanServer
+      // can scan online and offline tables, but does not require the location 
of the tablet. It
+      // only requires the KeyExtent. Find the first extent for the table that 
matches the
+      // startRow provided in the scanState. If no startRow is provided, use 
the first KeyExtent
+      // for the table
       binnedRanges.clear();
-      List<Range> failures = tabletLocator.binRanges(context, ranges, 
binnedRanges);
-
-      if (failures.isEmpty()) {
-        break;
-      } else {
-        // tried to only do table state checks when failures.size() == 
ranges.size(), however this
-        // did
-        // not work because nothing ever invalidated entries in the 
tabletLocator cache... so even
-        // though
-        // the table was deleted the tablet locator entries for the deleted 
table were not
-        // cleared... so
-        // need to always do the check when failures occur
-        if (failures.size() >= lastFailureSize) {
-          context.requireNotDeleted(tableId);
-          context.requireNotOffline(tableId, tableName);
+      Map<KeyExtent,List<Range>> map = new HashMap<>();
+      ranges.forEach(r -> {
+        TabletsMetadata tm = 
context.getAmple().readTablets().forTable(this.tableId)
+            .overlapping(r.getStartKey() == null ? null : 
r.getStartKey().getRow(),
+                r.isStartKeyInclusive(), r.getEndKey() == null ? null : 
r.getEndKey().getRow())
+            .build();

Review Comment:
   @keith-turner - I created a new, different cache class in d73b879 that has 
different logic and implementation than the ConcurrentKeyExtentCache in the 
bulk import code. I'm going to kick off an IT run to ensure that this cache is 
working (I think it is based on the limited IT tests that I ran locally). Would 
be interested in your feedback on the logic in the new cache and whether or not 
it can replace the cache in the bulk import code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to