public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl implements Comparable<GridDhtLocalPartition>, GridReservable
GridCacheConcurrentMap.CacheMapHolder| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_DELETE_QUEUE_SIZE
Maximum size for delete queue.
|
| Constructor and Description |
|---|
GridDhtLocalPartition(GridCacheSharedContext ctx,
CacheGroupContext grp,
int id) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addReservation(GridDhtPartitionsReservation r)
Adds group reservation to this partition.
|
void |
awaitDestroy()
Awaits completion of partition destroy process in case of
EVICTED partition state. |
boolean |
backup(AffinityTopologyVersion topVer) |
void |
cleanupRemoveQueue() |
void |
clearAsync()
Initiates single clear process if partition is in MOVING state or continues cleaning for RENTING state.
|
int |
compareTo(GridDhtLocalPartition part) |
long |
createTime() |
IgniteCacheOffheapManager.CacheDataStore |
dataStore() |
void |
decrementPublicSize(GridCacheConcurrentMap.CacheMapHolder hld,
GridCacheEntryEx e)
Decrements public size.
|
void |
destroy()
Destroys partition data store and invokes appropriate callbacks.
|
protected GridCacheConcurrentMap.CacheMapHolder |
entriesMap(GridCacheContext cctx) |
protected GridCacheConcurrentMap.CacheMapHolder |
entriesMapIfExists(Integer cacheId) |
boolean |
equals(Object obj) |
void |
finalizeUpdateCountres()
Flushes pending update counters closing all possible gaps.
|
long |
fullSize() |
long |
getAndIncrementUpdateCounter(long delta)
Updates MVCC cache update counter on primary node.
|
CacheGroupContext |
group()
Returns group context.
|
int |
hashCode() |
int |
id() |
void |
incrementPublicSize(GridCacheConcurrentMap.CacheMapHolder hld,
GridCacheEntryEx e)
Increments public size.
|
long |
initialUpdateCounter() |
void |
initialUpdateCounter(long val) |
int |
internalSize()
Returns the number of key-value mappings in this map.
|
boolean |
isClearing() |
boolean |
isEmpty() |
void |
lock()
Locks partition.
|
boolean |
markForDestroy() |
boolean |
markLost() |
void |
moving()
Forcibly moves partition to a MOVING state.
|
long |
nextUpdateCounter(int cacheId,
AffinityTopologyVersion topVer,
boolean primary,
Long primaryCntr) |
void |
onCacheStopped(int cacheId) |
void |
onClearFinished(IgniteInClosure<? super IgniteInternalFuture<?>> lsnr)
Adds listener on
clearFuture finish. |
void |
onDeferredDelete(int cacheId,
KeyCacheObject key,
GridCacheVersion ver) |
void |
onRemoved(GridDhtCacheEntry entry) |
void |
onUnlock()
On partition unlock callback.
|
boolean |
own() |
boolean |
primary(AffinityTopologyVersion topVer) |
int |
publicSize(int cacheId)
Returns the number of publicly available key-value mappings in this map.
|
void |
release()
Releases previously reserved partition.
|
protected void |
release(int sizeChange,
GridCacheConcurrentMap.CacheMapHolder hld,
GridCacheEntryEx e) |
void |
removeReservation(GridDhtPartitionsReservation r) |
IgniteInternalFuture<?> |
rent(boolean updateSeq)
Initiates partition eviction process.
|
int |
reservations() |
boolean |
reserve()
Reserves a partition so it won't be cleared or evicted.
|
void |
restoreState(GridDhtPartitionState stateToRestore) |
void |
setState(GridDhtPartitionState toState)
For testing purposes only.
|
GridDhtPartitionState |
state() |
String |
toString() |
boolean |
tryClear(EvictionContext evictionCtx)
Tries to start partition clear process
clearAll(EvictionContext)). |
void |
tryContinueClearing()
Continues delayed clearing of partition if possible.
|
void |
unlock()
Unlocks partition.
|
long |
updateCounter() |
void |
updateCounter(long val) |
void |
updateCounter(long start,
long delta)
Updates MVCC cache update counter on backup node.
|
boolean |
valid() |
entries, entrySet, getEntry, putEntryIfObsoleteOrAbsent, putEntryIfObsoleteOrAbsent, removeEntrypublic static final int MAX_DELETE_QUEUE_SIZE
public GridDhtLocalPartition(GridCacheSharedContext ctx, CacheGroupContext grp, int id)
ctx - Context.grp - Cache group.id - Partition ID.public int internalSize()
internalSize in interface GridCacheConcurrentMapprotected GridCacheConcurrentMap.CacheMapHolder entriesMap(GridCacheContext cctx)
entriesMap in class GridCacheConcurrentMapImplcctx - Cache context.@Nullable protected GridCacheConcurrentMap.CacheMapHolder entriesMapIfExists(Integer cacheId)
entriesMapIfExists in class GridCacheConcurrentMapImplcacheId - Cache ID.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 long createTime()
public GridDhtPartitionState state()
public int reservations()
public boolean isEmpty()
True if partition is empty.public boolean valid()
public void onRemoved(GridDhtCacheEntry entry)
entry - Entry to remove.public void cleanupRemoveQueue()
public void onDeferredDelete(int cacheId,
KeyCacheObject key,
GridCacheVersion ver)
cacheId - cacheId Cache ID.key - Removed key.ver - Removed version.public void lock()
public void unlock()
public boolean reserve()
reserve in interface GridReservablereserve in class GridCacheConcurrentMapImplTrue if reserved.public void release()
release in interface GridReservablerelease in class GridCacheConcurrentMapImplprotected void release(int sizeChange,
GridCacheConcurrentMap.CacheMapHolder hld,
GridCacheEntryEx e)
release in class GridCacheConcurrentMapImplsizeChange - Size delta.hld - Map holder.e - Map entry.public void restoreState(GridDhtPartitionState stateToRestore)
stateToRestore - State to restore.public void setState(GridDhtPartitionState toState)
toState - State to set.public boolean own()
True if transitioned to OWNING state.public void moving()
public boolean markLost()
True if partition state changed.public IgniteInternalFuture<?> rent(boolean updateSeq)
updateSeq - If true topology update sequence will be updated after eviction is finished.public void clearAsync()
public void tryContinueClearing()
public boolean markForDestroy()
True if partition is safe to destroy.public void destroy()
public void awaitDestroy()
EVICTED partition state.public void onClearFinished(IgniteInClosure<? super IgniteInternalFuture<?>> lsnr)
clearFuture finish.lsnr - Listener.public boolean isClearing()
True if clearing process is running at the moment on the partition.public boolean tryClear(EvictionContext evictionCtx) throws NodeStoppingException
clearAll(EvictionContext)).
Only one thread is allowed to do such process concurrently.
At the end of clearing method completes clearFuture.false if clearing is not started due to existing reservations.NodeStoppingException - If node is stopping.public void onUnlock()
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(int cacheId,
AffinityTopologyVersion topVer,
boolean primary,
@Nullable
Long primaryCntr)
cacheId - ID of cache initiated counter update.topVer - Topology version for current operation.public long updateCounter()
public void updateCounter(long val)
val - Update counter value.public long initialUpdateCounter()
public void initialUpdateCounter(long val)
val - Initial update counter value.public long getAndIncrementUpdateCounter(long delta)
delta - Value to be added to update counter.public void updateCounter(long start,
long delta)
start - Start positiondelta - Delta.public long fullSize()
public int compareTo(@NotNull
GridDhtLocalPartition part)
compareTo in interface Comparable<GridDhtLocalPartition>public int publicSize(int cacheId)
publicSize in interface GridCacheConcurrentMapcacheId - Cache ID.public void incrementPublicSize(@Nullable
GridCacheConcurrentMap.CacheMapHolder hld,
GridCacheEntryEx e)
incrementPublicSize in interface GridCacheConcurrentMaphld - Cache map (passed as optimization to avoid cache map lookup for shared groups).e - Entry that caused public size change.public void decrementPublicSize(@Nullable
GridCacheConcurrentMap.CacheMapHolder hld,
GridCacheEntryEx e)
decrementPublicSize in interface GridCacheConcurrentMaphld - Cache map (passed as optimization to avoid cache map lookup for shared groups).e - Entry that caused public size change.public CacheGroupContext group()
public void onCacheStopped(int cacheId)
cacheId - Cache ID.public void finalizeUpdateCountres()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.5 Release Date : June 4 2019