public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl implements Comparable<GridDhtLocalPartition>, GridReservable
GridCacheConcurrentMap.CacheMapHolder| Modifier and Type | Field and Description |
|---|---|
static int |
DFLT_ATOMIC_CACHE_DELETE_HISTORY_SIZE |
static int |
DFLT_CACHE_REMOVE_ENTRIES_TTL |
static int |
MAX_DELETE_QUEUE_SIZE
Maximum size for delete queue.
|
| Constructor and Description |
|---|
GridDhtLocalPartition(GridCacheSharedContext ctx,
CacheGroupContext grp,
int id,
boolean recovery) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addReservation(GridDhtPartitionsReservation r)
Adds group reservation to this partition.
|
boolean |
backup(AffinityTopologyVersion topVer) |
void |
beforeApplyBatch(boolean last)
Called before next batch is about to be applied during rebalance.
|
protected long |
clearAll(EvictionContext evictionCtx)
Removes all entries and rows from this partition.
|
IgniteInternalFuture<?> |
clearAsync()
Initiates a partition clearing attempt.
|
void |
clearDeferredDeletes()
Removes all deferred delete requests from
rmvQueue. |
int |
compareTo(@NotNull GridDhtLocalPartition part) |
long |
createTime() |
IgniteCacheOffheapManager.CacheDataStore |
dataStore() |
void |
decrementPublicSize(@Nullable GridCacheConcurrentMap.CacheMapHolder hld,
GridCacheEntryEx e)
Decrements public size.
|
void |
dumpDebugInfo(SB buf)
Collects detailed info about the partition.
|
protected GridCacheConcurrentMap.CacheMapHolder |
entriesMap(GridCacheContext cctx) |
protected @Nullable GridCacheConcurrentMap.CacheMapHolder |
entriesMapIfExists(Integer cacheId) |
boolean |
equals(Object o) |
GridLongList |
finalizeUpdateCounters()
Flushes pending update counters closing all possible gaps.
|
void |
finishEviction()
Moves partition state to
EVICTED if possible. |
long |
fullSize() |
long |
getAndIncrementUpdateCounter(long delta)
Increments cache update counter on primary node.
|
CacheGroupContext |
group()
Returns group context.
|
int |
hashCode() |
int |
id() |
void |
incrementPublicSize(@Nullable GridCacheConcurrentMap.CacheMapHolder hld,
GridCacheEntryEx e)
Increments public size.
|
long |
initialUpdateCounter() |
int |
internalSize()
Returns the number of key-value mappings in this map.
|
boolean |
isClearing() |
boolean |
isEmpty() |
boolean |
markLost() |
boolean |
moving()
Forcibly moves partition to a MOVING state.
|
long |
nextUpdateCounter(int cacheId,
AffinityTopologyVersion topVer,
boolean primary,
boolean init,
@Nullable Long primaryCntr)
Returns new update counter for primary node or passed counter for backup node.
|
long |
nextUpdateCounter(int cacheId,
IgniteInternalTx tx,
@Nullable Long primaryCntr)
Used for transactions.
|
void |
onCacheStopped(int cacheId) |
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()
Initiates partition eviction process and returns an eviction future.
|
int |
reservations() |
boolean |
reserve()
Reserves the partition so it won't be cleared or evicted.
|
long |
reservedCounter() |
void |
resetInitialUpdateCounter()
Reset partition initial update counter.
|
void |
resetUpdateCounter()
Reset partition update counter.
|
void |
restoreState(GridDhtPartitionState stateToRestore) |
void |
setState(GridDhtPartitionState toState)
For testing purposes only.
|
GridDhtPartitionState |
state() |
String |
toString() |
void |
tryContinueClearing()
Continue clearing if it was delayed before due to reservation and topology version not changed.
|
long |
updateCounter() |
void |
updateCounter(long val) |
boolean |
updateCounter(long start,
long delta)
Updates MVCC cache update counter on backup node.
|
boolean |
valid() |
entries, entrySet, getEntry, putEntryIfObsoleteOrAbsent, putEntryIfObsoleteOrAbsent, removeEntrypublic static final int DFLT_ATOMIC_CACHE_DELETE_HISTORY_SIZE
public static final int MAX_DELETE_QUEUE_SIZE
public static final int DFLT_CACHE_REMOVE_ENTRIES_TTL
public GridDhtLocalPartition(GridCacheSharedContext ctx, CacheGroupContext grp, int id, boolean recovery)
ctx - Context.grp - Cache group.id - Partition ID.recovery - Flag indicates that partition is created during recovery phase.public int internalSize()
internalSize in interface GridCacheConcurrentMapprotected GridCacheConcurrentMap.CacheMapHolder entriesMap(GridCacheContext cctx)
entriesMap in class GridCacheConcurrentMapImplcctx - Cache context.@Nullable protected @Nullable 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 onDeferredDelete(int cacheId,
KeyCacheObject key,
GridCacheVersion ver)
cacheId - cacheId Cache ID.key - Removed key.ver - Removed version.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 boolean moving()
True if a partition was switched to MOVING state.public boolean markLost()
True if partition state changed.public IgniteInternalFuture<?> rent()
RENTING or EVICTED.public void tryContinueClearing()
public IgniteInternalFuture<?> clearAsync()
public void finishEviction()
EVICTED if possible.public boolean isClearing()
True if clearing process is running at the moment on the partition.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,
boolean init,
@Nullable
@Nullable Long primaryCntr)
Used for non-tx cases.
Counter generation/update logic is delegated to counter implementation.
cacheId - ID of cache initiated counter update.topVer - Topology version for current operation.init - True if initial update.public long nextUpdateCounter(int cacheId,
IgniteInternalTx tx,
@Nullable
@Nullable Long primaryCntr)
cacheId - Cache id.tx - Tx.primaryCntr - Primary counter.public long updateCounter()
public long reservedCounter()
public void updateCounter(long val)
val - Update counter value.public long initialUpdateCounter()
public long getAndIncrementUpdateCounter(long delta)
delta - Value to be added to update counter.public boolean updateCounter(long start,
long delta)
start - Start positiondelta - Delta.public void resetUpdateCounter()
public void resetInitialUpdateCounter()
public long fullSize()
protected long clearAll(EvictionContext evictionCtx) throws NodeStoppingException
NodeStoppingException - If node stopping.public void clearDeferredDeletes()
rmvQueue.public int compareTo(@NotNull
@NotNull GridDhtLocalPartition part)
compareTo in interface Comparable<GridDhtLocalPartition>public int publicSize(int cacheId)
publicSize in interface GridCacheConcurrentMapcacheId - Cache ID.public void incrementPublicSize(@Nullable
@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
@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 GridLongList finalizeUpdateCounters()
public void beforeApplyBatch(boolean last)
last - True if last batch for partition.public void dumpDebugInfo(SB buf)
buf - Buffer.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.1 Release Date : December 20 2021