Package org.apache.hadoop.hbase.quotas
Interface RegionSizeStore
- All Superinterfaces:
HeapSize
,Iterable<Map.Entry<RegionInfo,
RegionSize>>
- All Known Implementing Classes:
NoOpRegionSizeStore
,RegionSizeStoreImpl
@Private
public interface RegionSizeStore
extends Iterable<Map.Entry<RegionInfo,RegionSize>>, HeapSize
An interface for concurrently storing and updating the size of a Region.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all entries from the store.getRegionSize
(RegionInfo regionInfo) Returns the size for the give region if one exists.void
incrementRegionSize
(RegionInfo regionInfo, long delta) Atomically alter the size of a region.boolean
isEmpty()
Returns if the store is empty.void
put
(RegionInfo regionInfo, long size) Atomically sets the givensize
for a region.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.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getRegionSize
Returns the size for the give region if one exists. If no size exists,null
is returned.- Parameters:
regionInfo
- The region whose size is being fetched.- Returns:
- The size in bytes of the region or null if no size is stored.
-
put
Atomically sets the givensize
for a region.- Parameters:
regionInfo
- An identifier for a region.size
- The size in bytes of the region.
-
incrementRegionSize
Atomically alter the size of a region.- Parameters:
regionInfo
- The region to update.delta
- The change in size for the region, positive or negative.
-
remove
Removes the mapping for the given key, returning the value if one exists in the store.- Parameters:
regionInfo
- The key to remove from the store- Returns:
- The value removed from the store if one exists, otherwise null.
-
size
int size()Returns the number of entries in the store.- Returns:
- The number of entries in the store.
-
isEmpty
boolean isEmpty()Returns if the store is empty.- Returns:
- true if there are no entries in the store, otherwise false.
-
clear
void clear()Removes all entries from the store.
-