@InterfaceAudience.Private public final class NoOpRegionSizeStore extends Object implements RegionSizeStore
RegionSizeStore
implementation that stores nothing.Modifier and Type | Field and Description |
---|---|
private static NoOpRegionSizeStore |
INSTANCE |
Modifier | Constructor and Description |
---|---|
private |
NoOpRegionSizeStore() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all entries from the store.
|
static NoOpRegionSizeStore |
getInstance() |
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
size for 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, wait
forEach, spliterator
private static final NoOpRegionSizeStore INSTANCE
private NoOpRegionSizeStore()
public static NoOpRegionSizeStore getInstance()
public Iterator<Map.Entry<RegionInfo,RegionSize>> iterator()
iterator
in interface Iterable<Map.Entry<RegionInfo,RegionSize>>
public long heapSize()
public RegionSize getRegionSize(RegionInfo regionInfo)
RegionSizeStore
null
is
returned.getRegionSize
in interface RegionSizeStore
regionInfo
- The region whose size is being fetched.public void put(RegionInfo regionInfo, long size)
RegionSizeStore
size
for a region.put
in interface RegionSizeStore
regionInfo
- An identifier for a region.size
- The size in bytes of the region.public void incrementRegionSize(RegionInfo regionInfo, long delta)
RegionSizeStore
incrementRegionSize
in interface RegionSizeStore
regionInfo
- The region to update.delta
- The change in size for the region, positive or negative.public RegionSize remove(RegionInfo regionInfo)
RegionSizeStore
remove
in interface RegionSizeStore
regionInfo
- The key to remove from the storepublic int size()
RegionSizeStore
size
in interface RegionSizeStore
public boolean isEmpty()
RegionSizeStore
isEmpty
in interface RegionSizeStore
public void clear()
RegionSizeStore
clear
in interface RegionSizeStore
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.