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.
|
| 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.
|
int |
compareTo(GridDhtLocalPartition part) |
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) |
long |
fullSize() |
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() |
void |
moving()
Forcibly moves partition to a MOVING state.
|
void |
onClearFinished(IgniteInClosure<? super IgniteInternalFuture<?>> lsnr)
Adds listener on
clearFuture finish. |
void |
onDeferredDelete(int cacheId,
KeyCacheObject key,
GridCacheVersion ver) |
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) |
GridDhtPartitionState |
state() |
String |
toString() |
boolean |
tryClear(EvictionContext evictionCtx)
Tries to start partition clear process
clearAll(EvictionContext)). |
void |
unlock()
Unlocks partition.
|
long |
updateCounter() |
void |
updateCounter(long val) |
boolean |
valid() |
entries, entrySet, getEntry, putEntryIfObsoleteOrAbsent, putEntryIfObsoleteOrAbsent, removeEntrypublic static final int MAX_DELETE_QUEUE_SIZE
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 GridDhtPartitionState state()
public int reservations()
public boolean isEmpty()
True if partition is empty.public boolean valid()
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 moving()
public IgniteInternalFuture<?> rent(boolean updateSeq)
updateSeq - If true topology update sequence will be updated after eviction is finished.public void clearAsync()
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 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 updateCounter()
public long initialUpdateCounter()
public void updateCounter(long val)
val - Update index value.public void initialUpdateCounter(long val)
val - Initial update index value.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.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.6.0 Release Date : July 10 2018