DomGarguilo commented on code in PR #3385:
URL: https://github.com/apache/accumulo/pull/3385#discussion_r1187692704
##########
server/base/src/main/java/org/apache/accumulo/server/metadata/ServerAmpleImpl.java:
##########
@@ -361,7 +364,8 @@ public void deleteScanServerFileReferences(String
serverAddress, UUID scanServer
int pLen = ScanServerFileReferenceSection.getRowPrefix().length();
Set<ScanServerRefTabletFile> refsToDelete =
StreamSupport.stream(scanner.spliterator(), false)
Review Comment:
```suggestion
Set<ScanServerRefTabletFile> refsToDelete = scanner.stream()
```
##########
server/base/src/main/java/org/apache/accumulo/server/metadata/ServerAmpleImpl.java:
##########
@@ -343,7 +345,8 @@ public Stream<ScanServerRefTabletFile>
getScanServerFileReferences() {
scanner.setRange(ScanServerFileReferenceSection.getRange());
int pLen = ScanServerFileReferenceSection.getRowPrefix().length();
return StreamSupport.stream(scanner.spliterator(), false)
Review Comment:
```suggestion
return scanner.stream().onClose(scanner::close)
```
This closes the scanner once the stream is closed (can't put the scanner in
try-with-resources block here since it would close the scanner before the
stream is used).
--
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]