@InterfaceAudience.Private public class RegionSizeStoreImpl extends Object implements RegionSizeStore
RegionSizeStore implementation backed by a ConcurrentHashMap. We expected similar
 amounts of reads and writes to the "store", so using a RWLock is not going to provide any
 exceptional gains.| Modifier and Type | Field and Description | 
|---|---|
| private static org.slf4j.Logger | LOG | 
| private static long | sizeOfEntry | 
| private ConcurrentHashMap<RegionInfo,RegionSize> | store | 
| Constructor and Description | 
|---|
| RegionSizeStoreImpl() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | clear()Removes all entries from the store. | 
| RegionSize | getRegionSize(RegionInfo regionInfo)Returns the size for the give region if one exists. | 
| long | heapSize() | 
| void | incrementRegionSize(RegionInfo regionInfo,
                   long delta)Atomically alter the size of a region. | 
| boolean | isEmpty()Returns if the store is empty. | 
| Iterator<Map.Entry<RegionInfo,RegionSize>> | iterator() | 
| void | put(RegionInfo regionInfo,
   long size)Atomically sets the given  sizefor a region. | 
| RegionSize | remove(RegionInfo regionInfo)Removes the mapping for the given key, returning the value if one exists in the store. | 
| int | size()Returns the number of entries in the store. | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorprivate static final org.slf4j.Logger LOG
private static final long sizeOfEntry
private final ConcurrentHashMap<RegionInfo,RegionSize> store
public RegionSizeStoreImpl()
public Iterator<Map.Entry<RegionInfo,RegionSize>> iterator()
iterator in interface Iterable<Map.Entry<RegionInfo,RegionSize>>public RegionSize getRegionSize(RegionInfo regionInfo)
RegionSizeStorenull is
 returned.getRegionSize in interface RegionSizeStoreregionInfo - The region whose size is being fetched.public void put(RegionInfo regionInfo, long size)
RegionSizeStoresize for a region.put in interface RegionSizeStoreregionInfo - An identifier for a region.size - The size in bytes of the region.public void incrementRegionSize(RegionInfo regionInfo, long delta)
RegionSizeStoreincrementRegionSize in interface RegionSizeStoreregionInfo - The region to update.delta - The change in size for the region, positive or negative.public RegionSize remove(RegionInfo regionInfo)
RegionSizeStoreremove in interface RegionSizeStoreregionInfo - The key to remove from the storepublic long heapSize()
public int size()
RegionSizeStoresize in interface RegionSizeStorepublic boolean isEmpty()
RegionSizeStoreisEmpty in interface RegionSizeStorepublic void clear()
RegionSizeStoreclear in interface RegionSizeStoreCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.