siddhantsangwan commented on code in PR #8707:
URL: https://github.com/apache/ozone/pull/8707#discussion_r2212362084
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerDataYaml.java:
##########
@@ -88,10 +96,11 @@ public static void createContainerFile(ContainerData
containerData, File contain
public static ContainerData readContainerFile(File containerFile)
throws IOException {
Preconditions.checkNotNull(containerFile, "containerFile cannot be null");
- try (InputStream inputFileStream =
Files.newInputStream(containerFile.toPath())) {
- return readContainer(inputFileStream);
- }
-
+ String originalContent = FileUtils.readFileToString(containerFile,
StandardCharsets.UTF_8);
+ ContainerData containerData =
+ readContainer(originalContent.getBytes(StandardCharsets.UTF_8));
+ containerData.setYamlData(originalContent);
Review Comment:
We don't need to keep this String in memory if the cache feature is
disabled, right? We need a configuration check here.
--
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]