public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl implements Comparable<GridDhtLocalPartition>, GridReservable
Modifier and Type | Field and Description |
---|---|
static int |
MAX_DELETE_QUEUE_SIZE
Maximum size for delete queue.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addReservation(GridDhtPartitionsReservation r)
Adds group reservation to this partition.
|
boolean |
backup(AffinityTopologyVersion topVer) |
void |
cleanupRemoveQueue() |
void |
clearAll()
Clears values for this partition.
|
int |
compareTo(GridDhtLocalPartition part) |
IgniteCacheOffheapManager.CacheDataStore |
dataStore() |
void |
decrementPublicSize(GridCacheEntryEx e)
Decrements public size.
|
boolean |
equals(Object obj) |
int |
hashCode() |
int |
id() |
void |
incrementPublicSize(GridCacheEntryEx e)
Increments public size.
|
Long |
initialUpdateCounter() |
void |
initialUpdateCounter(long val) |
boolean |
isEmpty() |
long |
lastAppliedUpdate() |
void |
lock()
Locks partition.
|
long |
nextUpdateCounter() |
void |
onDeferredDelete(KeyCacheObject key,
GridCacheVersion ver) |
void |
onEntryEvicted(KeyCacheObject key,
GridCacheVersion ver) |
void |
onUpdateReceived(long cntr) |
boolean |
preloadingPermitted(KeyCacheObject key,
GridCacheVersion ver)
Cache preloader should call this method within partition lock.
|
boolean |
primary(AffinityTopologyVersion topVer) |
int |
publicSize()
Returns the number of publicly available key-value mappings in this map.
|
void |
release()
Releases previously reserved partition.
|
protected void |
release(int sizeChange,
GridCacheEntryEx e) |
void |
removeReservation(GridDhtPartitionsReservation r) |
int |
reservations() |
boolean |
reserve()
Reserves a partition so it won't be cleared.
|
void |
restoreState(GridDhtPartitionState stateToRestore) |
boolean |
shouldBeRenting() |
GridDhtPartitionState |
state() |
String |
toString() |
void |
tryEvict() |
void |
unlock()
Unlocks partition.
|
long |
updateCounter() |
void |
updateCounter(long val) |
boolean |
valid() |
allEntries, entries, entrySet, getEntry, keySet, putEntryIfObsoleteOrAbsent, removeEntry, size
public static final int MAX_DELETE_QUEUE_SIZE
public IgniteCacheOffheapManager.CacheDataStore dataStore()
public boolean addReservation(GridDhtPartitionsReservation r)
r
- Reservation.false
If such reservation already added.public void removeReservation(GridDhtPartitionsReservation r)
r
- Reservation.public int id()
public GridDhtPartitionState state()
public boolean shouldBeRenting()
True
if partition is marked for transfer to renting state.public int reservations()
public boolean isEmpty()
True
if partition is empty.public long lastAppliedUpdate()
public void onUpdateReceived(long cntr)
cntr
- Received counter.public boolean valid()
public void cleanupRemoveQueue()
public void onDeferredDelete(KeyCacheObject key, GridCacheVersion ver)
key
- Removed key.ver
- Removed version.public void lock()
public void unlock()
public void onEntryEvicted(KeyCacheObject key, GridCacheVersion ver)
key
- Key.ver
- Version.public boolean preloadingPermitted(KeyCacheObject key, GridCacheVersion ver)
key
- Key.ver
- Version.True
if preloading is permitted.public boolean reserve()
reserve
in interface GridReservable
reserve
in class GridCacheConcurrentMapImpl
True
if reserved.public void release()
release
in interface GridReservable
release
in class GridCacheConcurrentMapImpl
protected void release(int sizeChange, GridCacheEntryEx e)
release
in class GridCacheConcurrentMapImpl
sizeChange
- Size delta.e
- Map entry.public void restoreState(GridDhtPartitionState stateToRestore)
stateToRestore
- State to restore.public void tryEvict() throws NodeStoppingException
NodeStoppingException
- If node is stopping.public boolean primary(AffinityTopologyVersion topVer)
topVer
- Topology version.True
if local node is primary for this partition.public boolean backup(AffinityTopologyVersion topVer)
topVer
- Topology version.True
if local node is backup for this partition.public long nextUpdateCounter()
public long updateCounter()
public Long initialUpdateCounter()
public void updateCounter(long val)
val
- Update index value.public void initialUpdateCounter(long val)
val
- Initial update index value.public void clearAll() throws NodeStoppingException
NodeStoppingException
- If node stopping.public int compareTo(@NotNull GridDhtLocalPartition part)
compareTo
in interface Comparable<GridDhtLocalPartition>
public int publicSize()
publicSize
in interface GridCacheConcurrentMap
public void incrementPublicSize(GridCacheEntryEx e)
incrementPublicSize
in interface GridCacheConcurrentMap
e
- Entry that caused public size change.public void decrementPublicSize(GridCacheEntryEx e)
decrementPublicSize
in interface GridCacheConcurrentMap
e
- Entry that caused public size change.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017