tanvipenumudy commented on code in PR #5391: URL: https://github.com/apache/ozone/pull/5391#discussion_r1483832264
########## hadoop-hdds/interface-server/src/main/proto/ScmServerProtocol.proto: ########## @@ -230,6 +233,60 @@ message SortDatanodesResponseProto{ repeated DatanodeDetailsProto node = 1; } +message NodeImpl { + required string name = 1; + required string location = 2; + required uint32 cost = 3; +} + +message CommandCount { + required SCMCommandProto.Type command = 1; + required uint32 count = 2; +} + +message NodeStatus { + required NodeOperationalState operationalState = 1; + required NodeState health = 2; + required uint64 opStateExpiryEpochSeconds = 3; +} + +message DatanodeInfo { + required DatanodeDetailsProto datanodeDetails = 1; + required uint64 lastHeartbeatTime = 2; + required uint64 lastStatsUpdatedTime = 3; + required uint32 failedVolumeCount = 4; + repeated StorageReportProto storageReportProto = 5; + repeated MetadataStorageReportProto metadataStorageReportProto = 6; + required LayoutVersionProto layoutVersionProto = 7; + repeated CommandCount commandCount = 8; + required NodeStatus nodeStatus = 9; +} + +message NodeType { + optional DatanodeDetailsProto datanodeDetails = 1; + optional DatanodeInfo datanodeInfo = 2; Review Comment:  - I was initially facing a few challenges while trying to include the parent information during serialization/deserialization. Every child object has a reference to its parent and similarly a parent has a reference to its child (as shown in the image: parent shown in white, child shown in yellow, for example). This sort of made the serialization/deserialization go on infinitely deeper. - I was looking at the existing implementation for serialization/deserialization of `DatanodeDetails` (which extends `NodeImpl`), where we are currently not including the parent information. So I went ahead with the second constructor of `NodeImpl` to create the object (which does not include the parent). - I am exploring to see if we could utilize `InnerNodeImpl#getNode` (by passing location of parent) post deserialization of information from protobuf to set the parent field once the `clusterTree` object has been created. Open to any suggestions, if there is a better way to approach this, thanks! -- 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-unsubscr...@ozone.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org