dlmarion commented on code in PR #3091:
URL: https://github.com/apache/accumulo/pull/3091#discussion_r1033628645
##########
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:
I found the KeyExtentCache in BulkImport. It looks like I should be able to
reuse this, although I will likely have to move it to a different package. I
may also need to modify it as it looks like the cached extents do not expire.
--
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]