tanvipenumudy commented on code in PR #5391:
URL: https://github.com/apache/ozone/pull/5391#discussion_r1470051169
##########
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 apologize if I have not understood the question initially, I was trying to
serialize and deserialize the interface: `Node` from the package:
`org.apache.hadoop.hdds.scm.net` (while interfaces in general are not really
meant to be serialized/deserialized).
- `Node` has a couple of implementations (direct/indirect):
`DatanodeDetails`, `DatanodeInfo`, `InnerNode`, `InnerNodeImpl`, `NodeImpl`.
- Hence, the `DatanodeDetailsProto` proto object has been included inside
`NodeType` (which is the corresponding proto object for the `Node` interface).
- But again, the `DatanodeInfo` class extends `DatanodeDetails` due to which
the `DatanodeDetailsProto` proto object has been added once more inside the
`DatanodeInfo` proto object.
Please suggest 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: [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]