DomGarguilo commented on code in PR #2811:
URL: https://github.com/apache/accumulo/pull/2811#discussion_r982408376
##########
server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java:
##########
@@ -95,9 +95,14 @@ public void run() {
// check the time so that the read ahead thread is not monopolized
while (iter.hasNext() && bytesAdded < maxResultsSize
&& (System.currentTimeMillis() - startTime) < maxScanTime) {
- Entry<KeyExtent,List<Range>> entry = iter.next();
- KeyExtent extent = entry.getKey();
- List<Range> ranges = entry.getValue();
+ final KeyExtent extent;
+ final List<Range> ranges;
+ {
+ final Entry<KeyExtent,List<Range>> entry = iter.next();
+ extent = entry.getKey();
+ ranges = entry.getValue();
+ }
Review Comment:
> Was this little code block created just to narrowly scope `entry`?
Yes. Maybe its not worth doing as it might cause confusion? What do you
think?
--
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]