public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedManager
| Modifier and Type | Class and Description |
|---|---|
static class |
GridCacheDatabaseSharedManager.FileLockHolder |
class |
GridCacheDatabaseSharedManager.RestoreBinaryState
Restore memory context.
|
class |
GridCacheDatabaseSharedManager.RestoreLogicalState
Restore logical state context.
|
| Modifier and Type | Field and Description |
|---|---|
protected Set<DataRegion> |
checkpointedDataRegions
Data regions which should be checkpointed.
|
static String |
DEFRAGMENTATION_MAPPING_REGION_NAME |
static String |
DEFRAGMENTATION_PART_REGION_NAME |
static int |
DFLT_DEFRAGMENTATION_REGION_SIZE_PERCENTAGE |
static int |
DFLT_PDS_WAL_REBALANCE_THRESHOLD |
static String |
IGNITE_PDS_CHECKPOINT_TEST_SKIP_SYNC |
static String |
IGNITE_PDS_LOG_CP_READ_LOCK_HOLDERS
Log read lock holders.
|
static String |
IGNITE_PDS_SKIP_CHECKPOINT_ON_NODE_STOP
Skip checkpoint on node stop flag.
|
static String |
METASTORE_DATA_REGION_NAME
MemoryPolicyConfiguration name reserved for meta store.
|
static String |
METASTORE_VIEW
Name of the system view for a system
MetaStorage. |
static String |
METASTORE_VIEW_DESC
Description of the system view for a
MetaStorage. |
DATA_REGION_PAGE_LIST_VIEW, DATA_REGION_PAGE_LIST_VIEW_DESC, dataRegionMap, dataRegionsInitialized, dfltDataRegion, freeListMap, INTERNAL_DATA_REGION_NAMES, reuseMemory, SYSTEM_DATA_REGION_NAMEcctx, diagnosticLog, log| Constructor and Description |
|---|
GridCacheDatabaseSharedManager(GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCheckpointListener(CheckpointListener lsnr) |
void |
addCheckpointListener(CheckpointListener lsnr,
DataRegion dataRegion) |
DataRegion |
addDataRegion(DataStorageConfiguration dataStorageCfg,
DataRegionConfiguration dataRegionCfg,
boolean trackable,
PageReadWriteManager pmPageMgr) |
void |
applyPageSnapshot(PageMemoryEx pageMem,
PageSnapshot pageSnapshotRecord) |
void |
applyUpdatesOnRecovery(@Nullable WALIterator it,
IgniteBiPredicate<WALPointer,WALRecord> recPredicate,
IgnitePredicate<DataEntry> entryPredicate)
Apply update from some iterator and with specific filters.
|
void |
beforeExchange(GridDhtPartitionsExchangeFuture fut) |
boolean |
cancelOrWaitPartitionDestroy(int grpId,
int partId)
Cancels or wait for partition destroy.
|
protected void |
checkPageSize(DataStorageConfiguration memCfg) |
File |
checkpointDirectory() |
Collection<DataRegion> |
checkpointedDataRegions() |
@Nullable CheckpointHistory |
checkpointHistory() |
boolean |
checkpointLockIsHeldByThread() |
void |
checkpointReadLock()
Gets the checkpoint read lock.
|
long |
checkpointReadLockTimeout()
Timeout for checkpoint read lock acquisition.
|
void |
checkpointReadLockTimeout(long val)
Sets timeout for checkpoint read lock acquisition.
|
void |
checkpointReadUnlock()
Releases the checkpoint read lock.
|
protected void |
checkRegionEvictionProperties(DataRegionConfiguration regCfg,
DataStorageConfiguration dbCfg) |
void |
cleanupCheckpointDirectory()
Clean checkpoint directory
CheckpointMarkersStorage.cpDir. |
void |
cleanupRestoredCaches()
Method will perform cleanup cache page memory and each cache partition store.
|
void |
cleanupTempCheckpointDirectory()
Cleanup checkpoint directory from all temporary files.
|
protected PageMemory |
createPageMemory(DirectMemoryProvider memProvider,
DataStorageConfiguration memCfg,
DataRegionConfiguration plcCfg,
DataRegionMetricsImpl memMetrics,
boolean trackable,
PageReadWriteManager pmPageMgr)
Creates PageMemory with given size and memory provider.
|
protected DataRegionMetricsProvider |
dataRegionMetricsProvider(DataRegionConfiguration dataRegCfg)
Provide that can be used to compute some metrics for provided data region.
|
CachePartitionDefragmentationManager |
defragmentationManager() |
IgniteInternalFuture<Void> |
enableCheckpoints(boolean enable)
For test use only.
|
CheckpointProgress |
forceCheckpoint(String reason)
Schedule a new checkpoint.
|
<R> CheckpointProgress |
forceNewCheckpoint(String reason,
IgniteInClosure<? super IgniteInternalFuture<R>> lsnr)
Schedule a new checkpoint.
|
Collection<GridCacheContext> |
forceRebuildIndexes(Collection<GridCacheContext> contexts)
Initiate an asynchronous forced index rebuild for caches.
|
long |
forGroupPageStores(CacheGroupContext gctx,
ToLongFunction<PageStore> f) |
protected IgniteOutClosure<Long> |
freeSpaceProvider(DataRegionConfiguration dataRegCfg)
Deprecated.
|
Checkpointer |
getCheckpointer() |
FilePageStoreManager |
getFileStoreManager() |
PageStore |
getPageStore(int grpId,
int partId) |
protected void |
initDataRegions(DataStorageConfiguration memCfg) |
protected void |
initDataRegions0(DataStorageConfiguration memCfg) |
boolean |
isCheckpointInapplicableForWalRebalance(Long cpTs,
int grpId)
Checks that checkpoint with timestamp
cpTs is inapplicable as start point for WAL rebalance for given group grpId. |
void |
lastCheckpointInapplicableForWalRebalance(int grpId)
Set last checkpoint as inapplicable for WAL rebalance for given group
grpId. |
WALPointer |
lastCheckpointMarkWalPointer() |
WALPointer |
latestWalPointerReservedForPreloading()
Returns the latest WAL pointer that reserved for preloading or
null. |
MetaStorage |
metaStorage() |
void |
notifyMetaStorageSubscribersOnReadyForRead()
Notifies
MetastorageLifecycleListener that MetaStorage is ready for read. |
void |
onActivate(GridKernalContext ctx)
Called when cluster performing activation.
|
void |
onCacheGroupsStopped(Collection<IgniteBiTuple<CacheGroupContext,Boolean>> stoppedGrps) |
void |
onDeActivate(GridKernalContext kctx)
Called when cluster performing deactivation.
|
protected void |
onKernalStop0(boolean cancel) |
void |
onStateRestored(AffinityTopologyVersion topVer)
Called when all partitions have been fully restored and pre-created on node start.
|
void |
onWalTruncated(@Nullable WALPointer highBound)
Wal truncate callback.
|
AtomicLong |
pageListCacheLimitHolder(DataRegion dataRegion) |
DataStorageMetrics |
persistentStoreMetrics() |
DataStorageMetricsImpl |
persistentStoreMetricsImpl() |
boolean |
preferWalRebalance()
Returns true if historical rebalance is preferred,
false means using heuristic for determine rebalance type.
|
void |
preserveWalTailPointer() |
void |
rebuildIndexesIfNeeded(GridDhtPartitionsExchangeFuture exchangeFut) |
protected void |
registerMetricsMBeans(IgniteConfiguration cfg)
Registers MBeans for all DataRegionMetrics configured in this instance.
|
void |
releaseHistoryForExchange()
Release reserved update history.
|
void |
releaseHistoryForPreloading()
Release reserved update history.
|
void |
removeCheckpointListener(CheckpointListener lsnr) |
Map<Integer,Map<Integer,Long>> |
reserveHistoryForExchange()
Reserve update history for exchange.
|
boolean |
reserveHistoryForPreloading(Map<T2<Integer,Integer>,Long> reservationMap)
Reserve update history for preloading.
|
void |
resumeWalLogging() |
void |
schedulePartitionDestroy(int grpId,
int partId)
Adds given partition to checkpointer destroy queue.
|
void |
setThreadBuf(ThreadLocal<ByteBuffer> threadBuf)
Replace thread local with buffers.
|
protected void |
start0() |
void |
startMemoryRestore(GridKernalContext kctx,
TimeBag startTimer)
Perform memory restore before
GridDiscoveryManager start. |
protected void |
stop0(boolean cancel) |
void |
stripedApply(Runnable run,
int grpId,
int partId,
StripedExecutor exec,
Semaphore semaphore) |
void |
stripedApplyPage(Consumer<PageMemoryEx> consumer,
int grpId,
int partId,
StripedExecutor exec,
Semaphore semaphore) |
MetaStorage.TmpStorage |
temporaryMetaStorage() |
void |
temporaryMetaStorage(MetaStorage.TmpStorage tmpMetaStorage) |
<R> void |
waitForCheckpoint(String reason,
IgniteInClosure<? super IgniteInternalFuture<R>> lsnr)
Waits until current state is checkpointed and execution listeners after finish.
|
@Nullable IgniteInternalFuture |
wakeupForCheckpoint(String reason) |
boolean |
walEnabled(int grpId,
boolean local) |
void |
walEnabled(int grpId,
boolean enabled,
boolean local)
Marks cache group as with disabled WAL.
|
addDataRegion, buildAllocPath, buildPath, createPageEvictionTracker, dataRegion, dataRegions, dumpStatistics, ensureFreeSpace, ensureFreeSpaceForInsert, freeList, getDatabaseListeners, initAndStartRegions, initPageMemoryDataStructures, memoryMetrics, memoryMetrics, pageSize, prepareCachesStop, registerMetricsMBean, reuseList, setPageSize, supportsMemoryReuse, systemDateRegionName, unregisterMetricsMBean, waitForCheckpointcontext, isStopping, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStart, onKernalStart0, onKernalStop, onReconnected, printMemoryStats, start, startInfo, stop, stopInfo, toString@SystemProperty(value="Sets the flag controlling if the I/O sync needs to be skipped on a checkpoint") public static final String IGNITE_PDS_CHECKPOINT_TEST_SKIP_SYNC
@SystemProperty(value="Sets the flag controlling of a checkpoint needs to be skipped during a node termination") public static final String IGNITE_PDS_SKIP_CHECKPOINT_ON_NODE_STOP
@SystemProperty(value="Enables log checkpoint read lock holders") public static final String IGNITE_PDS_LOG_CP_READ_LOCK_HOLDERS
public static final String METASTORE_DATA_REGION_NAME
public static final String METASTORE_VIEW
MetaStorage.public static final String METASTORE_VIEW_DESC
MetaStorage.public static final String DEFRAGMENTATION_PART_REGION_NAME
public static final String DEFRAGMENTATION_MAPPING_REGION_NAME
public static final int DFLT_PDS_WAL_REBALANCE_THRESHOLD
public static final int DFLT_DEFRAGMENTATION_REGION_SIZE_PERCENTAGE
protected final Set<DataRegion> checkpointedDataRegions
public GridCacheDatabaseSharedManager(GridKernalContext ctx)
ctx - Kernal context.public FilePageStoreManager getFileStoreManager()
public Checkpointer getCheckpointer()
public boolean preferWalRebalance()
public IgniteInternalFuture<Void> enableCheckpoints(boolean enable)
protected void initDataRegions0(DataStorageConfiguration memCfg) throws IgniteCheckedException
initDataRegions0 in class IgniteCacheDatabaseSharedManagermemCfg - Database config.IgniteCheckedException - If failed to initialize swap path.protected void start0()
throws IgniteCheckedException
start0 in class IgniteCacheDatabaseSharedManagerIgniteCheckedException - If failed.protected void initDataRegions(DataStorageConfiguration memCfg) throws IgniteCheckedException
initDataRegions in class IgniteCacheDatabaseSharedManagermemCfg - Database config.IgniteCheckedException - If failed to initialize swap path.public Collection<DataRegion> checkpointedDataRegions()
public void cleanupTempCheckpointDirectory()
throws IgniteCheckedException
cleanupTempCheckpointDirectory in class IgniteCacheDatabaseSharedManagerIgniteCheckedExceptionpublic void cleanupRestoredCaches()
cleanupRestoredCaches in class IgniteCacheDatabaseSharedManagerpublic void cleanupCheckpointDirectory()
throws IgniteCheckedException
CheckpointMarkersStorage.cpDir. The operation
is necessary when local node joined to baseline topology with different consistentId.cleanupCheckpointDirectory in class IgniteCacheDatabaseSharedManagerIgniteCheckedExceptionpublic CachePartitionDefragmentationManager defragmentationManager()
public DataRegion addDataRegion(DataStorageConfiguration dataStorageCfg, DataRegionConfiguration dataRegionCfg, boolean trackable, PageReadWriteManager pmPageMgr) throws IgniteCheckedException
addDataRegion in class IgniteCacheDatabaseSharedManagerdataStorageCfg - Database config.dataRegionCfg - Data region config.pmPageMgr - Page manager.IgniteCheckedException - If failed to initialize swap path.public void onActivate(GridKernalContext ctx) throws IgniteCheckedException
onActivate in interface IgniteChangeGlobalStateSupportonActivate in class IgniteCacheDatabaseSharedManagerctx - Kernal context.IgniteCheckedException - If failed.public void onDeActivate(GridKernalContext kctx)
onDeActivate in interface IgniteChangeGlobalStateSupportonDeActivate in class IgniteCacheDatabaseSharedManagerkctx - Kernal context.protected void registerMetricsMBeans(IgniteConfiguration cfg)
registerMetricsMBeans in class IgniteCacheDatabaseSharedManagercfg - Ignite configuration.@Deprecated protected IgniteOutClosure<Long> freeSpaceProvider(DataRegionConfiguration dataRegCfg)
freeSpaceProvider in class IgniteCacheDatabaseSharedManagerdataRegCfg - Data region configuration.protected DataRegionMetricsProvider dataRegionMetricsProvider(DataRegionConfiguration dataRegCfg)
dataRegionMetricsProvider in class IgniteCacheDatabaseSharedManagerdataRegCfg - Data region configuration.protected void onKernalStop0(boolean cancel)
onKernalStop0 in class GridCacheSharedManagerAdaptercancel - Cancel flag.protected void stop0(boolean cancel)
stop0 in class IgniteCacheDatabaseSharedManagercancel - Cancel flag.protected PageMemory createPageMemory(DirectMemoryProvider memProvider, DataStorageConfiguration memCfg, DataRegionConfiguration plcCfg, DataRegionMetricsImpl memMetrics, boolean trackable, PageReadWriteManager pmPageMgr)
createPageMemory in class IgniteCacheDatabaseSharedManagermemProvider - Memory provider.memCfg - Memory configuartion.plcCfg - data region configuration.memMetrics - DataRegionMetrics to collect memory usage metrics.pmPageMgr - Page manager.protected void checkRegionEvictionProperties(DataRegionConfiguration regCfg, DataStorageConfiguration dbCfg) throws IgniteCheckedException
checkRegionEvictionProperties in class IgniteCacheDatabaseSharedManagerregCfg - DataRegionConfiguration to validate.dbCfg - Memory configuration.IgniteCheckedException - If config is invalid.protected void checkPageSize(DataStorageConfiguration memCfg)
checkPageSize in class IgniteCacheDatabaseSharedManagermemCfg - Memory config.public void beforeExchange(GridDhtPartitionsExchangeFuture fut) throws IgniteCheckedException
beforeExchange in class IgniteCacheDatabaseSharedManagerfut - Before exchange for the given discovery event.IgniteCheckedExceptionpublic void rebuildIndexesIfNeeded(GridDhtPartitionsExchangeFuture exchangeFut)
rebuildIndexesIfNeeded in class IgniteCacheDatabaseSharedManagerexchangeFut - Partition exchange future.public Collection<GridCacheContext> forceRebuildIndexes(Collection<GridCacheContext> contexts)
forceRebuildIndexes in class IgniteCacheDatabaseSharedManagercontexts - Cache contexts.public void onCacheGroupsStopped(Collection<IgniteBiTuple<CacheGroupContext,Boolean>> stoppedGrps)
onCacheGroupsStopped in class IgniteCacheDatabaseSharedManagerstoppedGrps - A collection of tuples (cache group, destroy flag).public void checkpointReadLock()
checkpointReadLock in class IgniteCacheDatabaseSharedManagerIgniteException - If failed.public boolean checkpointLockIsHeldByThread()
checkpointLockIsHeldByThread in interface CheckpointLockStateCheckercheckpointLockIsHeldByThread in class IgniteCacheDatabaseSharedManagerpublic void checkpointReadUnlock()
checkpointReadUnlock in class IgniteCacheDatabaseSharedManagerpublic Map<Integer,Map<Integer,Long>> reserveHistoryForExchange()
reserveHistoryForExchange in class IgniteCacheDatabaseSharedManagerpublic void releaseHistoryForExchange()
releaseHistoryForExchange in class IgniteCacheDatabaseSharedManagerpublic boolean reserveHistoryForPreloading(Map<T2<Integer,Integer>,Long> reservationMap)
reserveHistoryForPreloading in class IgniteCacheDatabaseSharedManagerreservationMap - Map contains of counters for partitions of groups.public void releaseHistoryForPreloading()
releaseHistoryForPreloading in class IgniteCacheDatabaseSharedManagerpublic WALPointer latestWalPointerReservedForPreloading()
null.latestWalPointerReservedForPreloading in class IgniteCacheDatabaseSharedManagernull if nothing reserved.@Nullable public @Nullable IgniteInternalFuture wakeupForCheckpoint(String reason)
wakeupForCheckpoint in class IgniteCacheDatabaseSharedManagerpublic <R> void waitForCheckpoint(String reason, IgniteInClosure<? super IgniteInternalFuture<R>> lsnr) throws IgniteCheckedException
waitForCheckpoint in class IgniteCacheDatabaseSharedManagerreason - Reason for checkpoint wakeup if it would be required.lsnr - Listeners which should be called in checkpoint thread after current checkpoint finished.IgniteCheckedException - If failed.public CheckpointProgress forceCheckpoint(String reason)
Note: if a checkpoint is already running and the locks have not been taken yet, then a new checkpoint will not be forced.
forceCheckpoint in class IgniteCacheDatabaseSharedManagerreason - Reason.public <R> CheckpointProgress forceNewCheckpoint(String reason, IgniteInClosure<? super IgniteInternalFuture<R>> lsnr)
forceNewCheckpoint in class IgniteCacheDatabaseSharedManagerreason - Reason.lsnr - Listener which will be called on scheduled checkpoint finish.public WALPointer lastCheckpointMarkWalPointer()
lastCheckpointMarkWalPointer in class IgniteCacheDatabaseSharedManagerpublic File checkpointDirectory()
public void addCheckpointListener(CheckpointListener lsnr, DataRegion dataRegion)
lsnr - Listener.dataRegion - Data region for which listener is corresponded to.public void addCheckpointListener(CheckpointListener lsnr)
lsnr - Listener.public void removeCheckpointListener(CheckpointListener lsnr)
lsnr - Listener.public void startMemoryRestore(GridKernalContext kctx, TimeBag startTimer) throws IgniteCheckedException
GridDiscoveryManager start.startMemoryRestore in class IgniteCacheDatabaseSharedManagerkctx - Current kernal context.startTimer - Holder of start time of stages.IgniteCheckedException - If fails.public void resumeWalLogging()
throws IgniteCheckedException
IgniteCheckedExceptionpublic void preserveWalTailPointer()
throws IgniteCheckedException
IgniteCheckedExceptionpublic PageStore getPageStore(int grpId, int partId) throws IgniteCheckedException
grpId - Cache group id.partId - Partition ID.IgniteCheckedException - If failed.public long forGroupPageStores(CacheGroupContext gctx, ToLongFunction<PageStore> f)
gctx - Group context.f - Consumer.public void onStateRestored(AffinityTopologyVersion topVer) throws IgniteCheckedException
onStateRestored in class IgniteCacheDatabaseSharedManagerIgniteCheckedException - If first checkpoint has failed.public void stripedApplyPage(Consumer<PageMemoryEx> consumer, int grpId, int partId, StripedExecutor exec, Semaphore semaphore) throws IgniteCheckedException
consumer - Runnable task.grpId - Group Id.partId - Partition Id.exec - Striped executor.IgniteCheckedExceptionpublic void stripedApply(Runnable run, int grpId, int partId, StripedExecutor exec, Semaphore semaphore)
run - Runnable task.grpId - Group Id.partId - Partition Id.exec - Striped executor.public void applyPageSnapshot(PageMemoryEx pageMem, PageSnapshot pageSnapshotRecord) throws IgniteCheckedException
pageMem - Page memory.pageSnapshotRecord - Page snapshot record.IgniteCheckedException - If failed.public void applyUpdatesOnRecovery(@Nullable
@Nullable WALIterator it,
IgniteBiPredicate<WALPointer,WALRecord> recPredicate,
IgnitePredicate<DataEntry> entryPredicate)
throws IgniteCheckedException
it - WalIterator.recPredicate - Wal record filter.entryPredicate - Entry filter.IgniteCheckedExceptionpublic void onWalTruncated(@Nullable
@Nullable WALPointer highBound)
throws IgniteCheckedException
highBound - Upper bound.IgniteCheckedException - If failed.public void setThreadBuf(ThreadLocal<ByteBuffer> threadBuf)
threadBuf - new thread-local with buffers for the checkpoint threads.@Nullable public @Nullable CheckpointHistory checkpointHistory()
public void schedulePartitionDestroy(int grpId,
int partId)
grpId - Group ID.partId - Partition ID.public boolean cancelOrWaitPartitionDestroy(int grpId,
int partId)
throws IgniteCheckedException
grpId - Group ID.partId - Partition ID.True if the request to destroy the partition was canceled.IgniteCheckedException - If failed.public long checkpointReadLockTimeout()
checkpointReadLockTimeout in class IgniteCacheDatabaseSharedManagerpublic void checkpointReadLockTimeout(long val)
checkpointReadLockTimeout in class IgniteCacheDatabaseSharedManagerval - New timeout in milliseconds, non-positive value denotes infinite timeout.public AtomicLong pageListCacheLimitHolder(DataRegion dataRegion)
public DataStorageMetrics persistentStoreMetrics()
persistentStoreMetrics in class IgniteCacheDatabaseSharedManagernull otherwise.public DataStorageMetricsImpl persistentStoreMetricsImpl()
public MetaStorage metaStorage()
metaStorage in class IgniteCacheDatabaseSharedManagerpublic MetaStorage.TmpStorage temporaryMetaStorage()
public void temporaryMetaStorage(MetaStorage.TmpStorage tmpMetaStorage)
tmpMetaStorage - Temporary metastorage to migration of index partition.public void notifyMetaStorageSubscribersOnReadyForRead()
throws IgniteCheckedException
MetastorageLifecycleListener that MetaStorage is ready for read.
This method is called when all processors and managers have already started and right before discovery manager.notifyMetaStorageSubscribersOnReadyForRead in class IgniteCacheDatabaseSharedManagerIgniteCheckedException - If failed.public boolean walEnabled(int grpId,
boolean local)
walEnabled in class IgniteCacheDatabaseSharedManagergrpId - Group ID.public void walEnabled(int grpId,
boolean enabled,
boolean local)
walEnabled in class IgniteCacheDatabaseSharedManagergrpId - Group id.enabled - flag.public boolean isCheckpointInapplicableForWalRebalance(Long cpTs, int grpId) throws IgniteCheckedException
cpTs is inapplicable as start point for WAL rebalance for given group grpId.cpTs - Checkpoint timestamp.grpId - Group ID.true if checkpoint cpTs is inapplicable as start point for WAL rebalance for grpId.IgniteCheckedException - If failed to check.public void lastCheckpointInapplicableForWalRebalance(int grpId)
grpId.lastCheckpointInapplicableForWalRebalance in class IgniteCacheDatabaseSharedManagergrpId - Group ID.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.1 Release Date : December 20 2021