Github user BinShi-SecularBird commented on the issue:

    https://github.com/apache/phoenix/pull/398
  
    @karanmehta93, I thought about it, but I eventually gave up for the reasons 
listed below:
    1. If we wrote this unit test, the unit test would look like in two ways
        a. In unit test, check GuidePostsInfo.GetEstimatedSize() is equal to a 
constant value or a value calculated in the ways mentioned in 
https://dzone.com/articles/estimating-java-object-sizes or 
https://github.com/twitter/commons/blob/master/src/java/com/twitter/common/objectsize/ObjectSizeCalculator.java.
 The former is useless if the developer forgot to change "int estimatedSize = 
..." in GuidePostsInfo's constructor, and the latter can only get an 
approximation of the object size.
        b. In unit test, list and check all the fields in GuidePostInfo are 
equal to what we have now. It seems overkilled and weird.
    2. We need to refactor GuidePostsInfo in the near future. I want to 
postpone how to calculate its object size and the unit test to that time.
    
    Please let me know if you have better idea.



---

Reply via email to