anuengineer commented on a change in pull request #521: HDDS-2592 Add Datanode
command to allow the datanode to persist its admin state
URL: https://github.com/apache/hadoop-ozone/pull/521#discussion_r374850764
##########
File path:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/DatanodeIdYaml.java
##########
@@ -82,6 +83,12 @@ public static DatanodeDetails readDatanodeIdFile(File path)
.setIpAddress(datanodeDetailsYaml.getIpAddress())
.setHostName(datanodeDetailsYaml.getHostName())
.setCertSerialId(datanodeDetailsYaml.getCertSerialId());
+ if (datanodeDetailsYaml.getPersistedOpState() != null) {
+ builder.setPersistedOpState(HddsProtos.NodeOperationalState.valueOf(
+ datanodeDetailsYaml.getPersistedOpState()));
+ }
+ builder.setPersistedOpStateExpiry(
Review comment:
Shouldn't this be also inside the if != null ? , I am going to presume that
even if we have no data, datanodeDetailsYaml.getPersistedOpStateExpiryEpochSec
is going to return zero, but since the expiry is a long, JVM would initialize
it to zero by default, would it not?. So curious why this check is outside the
if.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]