narendly commented on code in PR #2072:
URL: https://github.com/apache/helix/pull/2072#discussion_r860842513


##########
helix-core/src/main/java/org/apache/helix/HelixProperty.java:
##########
@@ -39,7 +39,7 @@
  * A wrapper class for ZNRecord. Used as a base class for IdealState, 
CurrentState, etc.
  */
 public class HelixProperty {

Review Comment:
   Correct me if I'm wrong, but because we "deep copy" `HelixProperty` and its 
internal `ZNRecord`, throughout Helix we can treat this as such, and that is, 
we can assume that it's immutable. But in the case that we do not clone it and 
simply take after the internal `ZNRecord` reference, such assumptions no longer 
hold and therefore may open up avenues where issues could creep in. And this 
particular change doesn't allow us to know whether its internal `ZNRecord` 
reference is being shared across different `HelixProperty` instances or not.
   
   Could we think of alternative ways to achieve this if you think this is 
necessary? For example, add a subclass of `HelixProperty` that shallow copies 
`ZNRecord`, so that there is no ambiguity?



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