huaxiang sun commented on HBASE-20411:

It seems that we can use LongAdder forĀ 

protected volatile long dataSize;

/** 'heapSize' tracks all Cell's heap size occupancy. This will include Cell 
POJO heap overhead.
 * When Cells in on heap area, this will include the cells data size as well.
protected volatile long heapSize;

/** off-heap size: the aggregated size of all data that is allocated off-heap 
including all
 * key-values that reside off-heap and the metadata that resides off-heap
protected volatile long offHeapSize;
to avoid lock contention. The sum() wont return the accurate result when thereĀ 
are concurrent updates. The argument is that the current way of implementation 
wont return accurate result as well. The cells have been added to the internal 
CellSet(concurrently), updating counters are synced, so reading the counters 
wont reflect the accurate cellSet size.

> Ameliorate MutableSegment synchronize
> -------------------------------------
>                 Key: HBASE-20411
>                 URL: https://issues.apache.org/jira/browse/HBASE-20411
>             Project: HBase
>          Issue Type: Bug
>            Reporter: stack
>            Priority: Major
>         Attachments: 41901.lock.svg
> This item is migrated from HBASE-20236 so it gets dedicated issue.
> Let me upload evidence that has this synchronize as a stake in our write-time 
> perf. I'll migrate the patch I posted with updates that come of comments 
> posted by [~mdrob] on the HBASE-20236 issue.

This message was sent by Atlassian JIRA

Reply via email to