You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/07/31 08:27:33 UTC
[GitHub] [ozone] sky76093016 commented on a change in pull request #2481: HDDS-5524. Use try-with-resources to properly close resources in DirectoryServerSource.java
sky76093016 commented on a change in pull request #2481:
URL: https://github.com/apache/ozone/pull/2481#discussion_r680329295
##########
File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/stream/DirectoryServerSource.java
##########
@@ -41,18 +42,19 @@ public DirectoryServerSource(Path root) {
* @param id name of the subdirectory to replitace relative to root.
*/
public Map<String, Path> getFilesToStream(String id)
- throws InterruptedException {
+ throws InterruptedException {
Map<String, Path> files = new HashMap<>();
final Path streamingDir = root.resolve(id);
try {
- Files.walk(streamingDir)
- .filter(Files::isRegularFile)
- .forEach(path -> {
- files.put(root.relativize(path).toString(), path);
- });
+ try (Stream<Path> list = Files.walk(streamingDir)
Review comment:
Thanks @adoroszlai for reviewing, I have fixed it.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org