yandrey321 commented on code in PR #10606:
URL: https://github.com/apache/ozone/pull/10606#discussion_r3475556434
##########
hadoop-ozone/freon/src/main/java/org/apache/hadoop/ozone/freon/HadoopFsGenerator.java:
##########
@@ -72,16 +73,21 @@ public class HadoopFsGenerator extends
HadoopBaseFreonGenerator
public Void call() throws Exception {
super.init();
- Path file = new Path(getRootPath() + "/" + generateObjectName(0));
- getFileSystem().mkdirs(file.getParent());
+ FileSystem fileSystem = getFileSystem();
+ try {
+ Path file = new Path(getRootPath() + "/" + generateObjectName(0));
+ fileSystem.mkdirs(file.getParent());
- contentGenerator =
- new ContentGenerator(fileSize.toBytes(), bufferSize, copyBufferSize,
- flushOrSync);
+ contentGenerator =
+ new ContentGenerator(fileSize.toBytes(), bufferSize, copyBufferSize,
+ flushOrSync);
- timer = getMetrics().timer("file-create");
+ timer = getMetrics().timer("file-create");
- runTests(this::createFile);
+ runTests(this::createFile);
+ } finally {
+ IOUtils.closeQuietly(fileSystem);
Review Comment:
if its the end of the test, the fix looks good
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]