swamirishi commented on code in PR #7495:
URL: https://github.com/apache/ozone/pull/7495#discussion_r1892316482
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/ContainerUtils.java:
##########
@@ -169,25 +171,37 @@ public static synchronized void writeDatanodeDetailsTo(
* @return {@link DatanodeDetails}
* @throws IOException If the id file is malformed or other I/O exceptions
*/
- public static synchronized DatanodeDetails readDatanodeDetailsFrom(File path)
- throws IOException {
+ public static synchronized DatanodeDetails readDatanodeDetailsFrom(File
path) throws IOException {
Review Comment:
nit: Can we avoid this non meaningful refactoring here. We can do this as
part of refactoring jira
##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/helpers/TestContainerUtils.java:
##########
@@ -133,6 +154,17 @@ private void assertWriteRead(@TempDir File tempDir,
assertEquals(details.getCurrentVersion(), read.getCurrentVersion());
}
+ private void assertWriteReadWithChangedIpAddress(@TempDir File tempDir,
+ DatanodeDetails details)
throws IOException {
+ // Write a single ID to the file and read it out
+ File file = new File(tempDir, "valid-values.id");
+ ContainerUtils.writeDatanodeDetailsTo(details, file, conf);
+
Review Comment:
nit: Avoid extra lines
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/ContainerUtils.java:
##########
@@ -169,25 +171,37 @@ public static synchronized void writeDatanodeDetailsTo(
* @return {@link DatanodeDetails}
* @throws IOException If the id file is malformed or other I/O exceptions
*/
- public static synchronized DatanodeDetails readDatanodeDetailsFrom(File path)
- throws IOException {
+ public static synchronized DatanodeDetails readDatanodeDetailsFrom(File
path) throws IOException {
if (!path.exists()) {
throw new IOException("Datanode ID file not found.");
}
+
Review Comment:
Why extra line?
--
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]