[ 
https://issues.apache.org/jira/browse/HBASE-16229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15388965#comment-15388965
 ] 

Anoop Sam John edited comment on HBASE-16229 at 7/22/16 4:18 PM:
-----------------------------------------------------------------

Fixed comment regarding ImmutableSegment not considering TR heap size.
Also I tried to make it more consistent. We have keySize() in Memstore and 
Segment. This return the cells cumulative size and not including any segment 
and/or memstore heap overhead.   There is size() method in both Segment and 
Memstore.  This returns the cells size + heap overhead.  In Memstore heapSize() 
was also present. This was always considered same as size().  Am continuing 
with that.  Segment do not have heapSize() method.

Memstore level and global RS level, the accounting happens based on cells size. 
Segment#keySize() and Memstore#keySize() will be in sync with this.
getFlusableSize() uses keySize().
Segment#size() (Including heap overhead) is considered for flush decision and 
in memory flush decision.

Also removed the setSize() from Segment.  It wont be a good idea to change 
one's size by some one else.  Let the segment handle it's size accounting.


was (Author: anoop.hbase):
Fixed comment regarding ImmutableSegment not considering TR heap size.
Also I tried to make it more consistent. We have keySize() in Memstore and 
Segment. This return the cells cumulative size and not including any segment 
and/or memstore heap overhead.   There is size() method in both Segment and 
Memstore.  This returns the cells size + heap overhead.  In Memstore heapSize() 
was also present. This was always considered same as size().  Am continuing 
with that.  Segment do not have heapSize() method.

Memstore level and global RS level, the accounting happens based on cells size. 
Segment#keySize() and Memstore#keySize() will be in sync with this.
getFlusableSize() uses keySize().
Segment#size() (Including heap overhead) is considered for flush decision and 
in memory flush decision.

> Cleaning up size and heapSize calculation
> -----------------------------------------
>
>                 Key: HBASE-16229
>                 URL: https://issues.apache.org/jira/browse/HBASE-16229
>             Project: HBase
>          Issue Type: Sub-task
>    Affects Versions: 2.0.0
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>             Fix For: 2.0.0
>
>         Attachments: HBASE-16229.patch, HBASE-16229_V2.patch, 
> HBASE-16229_V3.patch
>
>
> It is bit ugly now. For eg:
> AbstractMemStore
> {code}
> public final static long FIXED_OVERHEAD = ClassSize.align(
>       ClassSize.OBJECT +
>           (4 * ClassSize.REFERENCE) +
>           (2 * Bytes.SIZEOF_LONG));
>   public final static long DEEP_OVERHEAD = ClassSize.align(FIXED_OVERHEAD +
>       (ClassSize.ATOMIC_LONG + ClassSize.TIMERANGE_TRACKER +
>       ClassSize.CELL_SKIPLIST_SET + ClassSize.CONCURRENT_SKIPLISTMAP));
> {code}
> We include the heap overhead of Segment also here. It will be better the 
> Segment contains its overhead part and the Memstore impl uses the heap size 
> of all of its segments to calculate its size.
> Also this
> {code}
> public long heapSize() {
>     return getActive().getSize();
>   }
> {code}
> HeapSize to consider all segment's size not just active's. I am not able to 
> see an override method in CompactingMemstore.
> This jira tries to solve some of these.
> When we create a Segment, we seems pass some initial heap size value to it. 
> Why?  The segment object internally has to know what is its heap size not 
> like some one else dictate it.
> More to add when doing this cleanup



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to