You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ib...@apache.org on 2022/08/17 15:59:19 UTC
[accumulo] 06/07: Add comments
This is an automated email from the ASF dual-hosted git repository.
ibella pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
commit bac732a776034cd16b01fac7db99aa9bdbc4d7e5
Author: Bill Oley <bi...@gmail.com>
AuthorDate: Thu Jul 14 14:57:06 2022 -0400
Add comments
---
.../src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java
index 312dcf132a..d157e864ad 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java
@@ -81,6 +81,8 @@ public class LookupTask extends ScanTask<MultiScanResult> {
long maxScanTime = 4000;
long startTime = System.currentTimeMillis();
+ // Copy entries in session.queries (HashMap) to queryQueue (LinkedList)
+ // to better control the order when unfinished ranges are returned
LinkedList<Pair<KeyExtent,List<Range>>> queryQueue = new LinkedList<>();
session.queries.entrySet()
.forEach(e -> queryQueue.addLast(new Pair<>(e.getKey(), e.getValue())));
@@ -119,9 +121,13 @@ public class LookupTask extends ScanTask<MultiScanResult> {
if (isCancelled())
interruptFlag.set(true);
+ // Create new List here to collect the results from this Tablet.lookup() call
+ // Ensures that the yield code in Tablet can only compare a yield position
+ // to the results from that call
List<KVEntry> tabletResults = new ArrayList<>();
lookupResult = tablet.lookup(ranges, tabletResults, session.scanParams,
maxResultsSize - bytesAdded, interruptFlag);
+ // Add results from this Tablet.lookup() to the accumulated results
results.addAll(tabletResults);
// if the tablet was closed it it possible that the