smengcl commented on PR #4120:
URL: https://github.com/apache/ozone/pull/4120#issuecomment-1397672766

   > @smengcl, why do we need to mark the field as optional? If the message 
itself is optional, then the fields are never used. If someone wants to use 
that message, we should have the mandatory fields as required.
   
   Hi Nanda, as I mentioned previously in this PR comment:
   
   https://github.com/apache/ozone/pull/3824#discussion_r1011376445
   
   `required` field is an outdated concept in proto2, where protobuf 3 has 
completely ditched this concept, so every single field in proto3 is implicitly 
`optional`, reason being that user can always check the whether the field is 
set with `hasABCField()`.
   
   A significant drawback of `required` is that it makes it significantly 
harder to deprecate and remove a field in the future, which IIRC was also 
blocking Hadoop from moving to pure proto3. Although we are still using proto2 
syntax, I would suggest strongly moving away from `required` and embrace 
`optional`.


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