priyeshkaratha commented on PR #10426:
URL: https://github.com/apache/ozone/pull/10426#issuecomment-4679375033

   > @priyeshkaratha , I have two general questions,
   > 
   > 1. after this change, does the front end UI code need change too?
   > 2. what's the benefit or motivation of split into two DTOs?
   
   Hi @ChenSammi,
   
   The main motivation for splitting this into two DTOs is to ensure that each 
API returns a response that is relevant to its specific use case.
   
   The UI is already compatible with these API changes and has been validated. 
With the current shared DTO, when the download report API is invoked, the 
response includes fields related to pending deletion metrics, which are not 
applicable to the download insights feature and therefore appear as `null` or 
`0`.
   
   For example, the current response looks like:
   
   ```json
   {
     "status": "IN_PROGRESS",
     "totalPendingDeletionSize": null,
     "pendingDeletionPerDataNode": null,
     "totalNodesQueried": 0,
     "totalNodeQueriesFailed": 0
   }
   ```
   
   In this case, the response indicates that the operation is still in 
progress, but the remaining fields are either `null` or `0`, which do not 
provide meaningful information for the download insights workflow and can be 
confusing to users. Instead, it is preferable to return a response structure 
that is specific to the download feature and can convey an appropriate status 
or message.
   
   By using separate DTOs, each API returns only the fields that are relevant 
to its functionality. This results in cleaner responses, clearer API semantics, 
and avoids exposing irrelevant `null` or default-valued fields in the output.
   


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