navinko commented on code in PR #10405:
URL: https://github.com/apache/ozone/pull/10405#discussion_r3351997111


##########
hadoop-ozone/dist/src/main/smoketest/balancer/testBalancer.robot:
##########
@@ -160,7 +160,7 @@ Get All Container IDs
 
 Get Datanode Ozone Used Bytes Info
     [arguments]             ${uuid}
-    ${output} =    Execute    export DATANODES=$(ozone admin datanode list 
--json) && for datanode in $(echo "$\{DATANODES\}" | jq -r '.[].id'); do ozone 
admin datanode usageinfo --uuid=$\{datanode\} --json | jq 
'{(.[0].datanodeDetails.id.uuid) : .[0].ozoneUsed}'; done | jq -s add
+    ${output} =    Execute    export DATANODES=$(ozone admin datanode list 
--json) && for datanode in $(echo "$\{DATANODES\}" | jq -r '.[].id'); do ozone 
admin datanode usageinfo --uuid=$\{datanode\} --json | jq 
'{(.[0].datanodeDetails.uuidString) : .[0].ozoneUsed}'; done | jq -s add

Review Comment:
   > > ... , it look for getUuid() ...
   > 
   > This part is my confusion -- there is no getUuid() in DatanodeID before 
this change. The method we are renaming is getID(). So why it works before the 
change?
   > 
   > ```diff
   > +++ 
b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/protocol/DatanodeID.java
   > @@ -44,11 +44,6 @@ private DatanodeID(final UUID uuid) {
   >      this.uuidByteString = StringWithByteString.valueOf(uuid.toString());
   >    }
   >  
   > -  // Mainly used for JSON conversion
   > -  public String getID() {
   > -    return toString();
   > -  }
   > -
   > ```
   
   Hi @szetszwo , It is little confusing , i am trying to explain in sequence 
,apologies if still doesn't make sense. when getID was only there and we 
removed deprecated getUuid() the robot was still failing!
   
   The way we did is 
   1: we had removed deprecated getUuid() 
         - at this time getID() was there , and robot test failed.
         - the json having DatanodeDeatils obj like 
        
   > "datanodeDetails" : {
       "level" : 3,
       "cost" : 0,
       "id" : {
         "id" : "d4e1d299-0d01-440d-9111-75cc1500bb70",
         "byteString" : {
           "validUtf8" : true,
           "empty" : false
         }
       }
   
   -  Since we removed deprecated getUuid() ,we din't find uuid part of 
datanodeDetails,  to fix robot test we renamed exiting getID ->getUuid() , 
which makes robot test pass.
   
   # Below changeset -robot test was failed
   
   <img width="750" height="771" alt="image" 
src="https://github.com/user-attachments/assets/fce597a5-7c45-4ef7-8653-968d7a05067c";
 />
   
   # these are the json outputs from latest changsets
   
   > ### Latest patch -<-------- renamed getUuid() to getUuidStringForTesting"  
      
      
   
   >  "datanodeDetails" : {
   >     "level" : 3,
   >     "cost" : 0,
   >     "id" : {
   >       "byteString" : {
   >         "validUtf8" : true,
   >         "empty" : false
   >       },
   >       "uuidStringForTesting" : "3e4bb53d-5030-4f84-8f15-4287f3ab576e".     
   >     }
   
       - to fix we updated in robot test 
datanodeDetails.id.uuidStringForTesting 
       - in json o/p for ozone admin datanode usageinfo , uuidStringForTesting 
is part of datanodeDetails obj so for sure this is not only for testing . 
       
   - If we could not have renamed then o/p will be like below thats why robot 
test with datanodeDetails.id.uuid
      worked.
      
   >  "datanodeDetails" : {
       "level" : 3,
       "cost" : 0,
       "id" : {
         "byteString" : {
           "validUtf8" : true,
           "empty" : false
         },
         "uuid" : "3e4bb53d-5030-4f84-8f15-4287f3ab576e".     
       }
       
      
   
   
   
   



-- 
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]

Reply via email to