You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "DomGarguilo (via GitHub)" <gi...@apache.org> on 2023/05/08 17:27:33 UTC

[GitHub] [accumulo] DomGarguilo commented on a diff in pull request #3385: Encapsulate file metadata inside a new object

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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org