Class GridCacheDatabaseSharedManager
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter
-
- org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager
-
- org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager
-
- All Implemented Interfaces:
GridCacheSharedManager,CheckpointLockStateChecker,IgniteChangeGlobalStateSupport
public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGridCacheDatabaseSharedManager.NodeFileLockHolderNode file lock holder.classGridCacheDatabaseSharedManager.RestoreBinaryStateRestore memory context.classGridCacheDatabaseSharedManager.RestoreLogicalStateRestore logical state context.
-
Field Summary
Fields Modifier and Type Field Description protected Set<DataRegion>checkpointedDataRegionsData regions which should be checkpointed.static StringDEFRAGMENTATION_MAPPING_REGION_NAMEstatic StringDEFRAGMENTATION_PART_REGION_NAMEstatic intDFLT_DEFRAGMENTATION_REGION_SIZE_PERCENTAGEstatic intDFLT_PDS_WAL_REBALANCE_THRESHOLDstatic StringHISTORICAL_REBALANCE_THRESHOLD_DMS_KEYWAL rebalance threshold distributed configuration keystatic StringIGNITE_PDS_CHECKPOINT_TEST_SKIP_SYNCstatic StringIGNITE_PDS_LOG_CP_READ_LOCK_HOLDERSLog read lock holders.static StringIGNITE_PDS_SKIP_CHECKPOINT_ON_NODE_STOPSkip checkpoint on node stop flag.static StringMETASTORE_DATA_REGION_NAMEMemoryPolicyConfiguration name reserved for meta store.static StringMETASTORE_VIEWName of the system view for a systemMetaStorage.static StringMETASTORE_VIEW_DESCDescription of the system view for aMetaStorage.-
Fields inherited from class org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager
DATA_REGION_PAGE_LIST_VIEW, DATA_REGION_PAGE_LIST_VIEW_DESC, dataRegionMap, dataRegionsInitialized, dfltDataRegion, dsMetrics, freeListMap, INTERNAL_DATA_REGION_NAMES, PAGE_TS_HISTOGRAM_VIEW, PAGE_TS_HISTOGRAM_VIEW_DESC, reuseMemory, SYSTEM_DATA_REGION_NAME
-
Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter
cctx, diagnosticLog, log
-
-
Constructor Summary
Constructors Constructor Description GridCacheDatabaseSharedManager(GridKernalContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCheckpointListener(CheckpointListener lsnr)voidaddCheckpointListener(CheckpointListener lsnr, DataRegion dataRegion)DataRegionaddDataRegion(DataStorageConfiguration dataStorageCfg, DataRegionConfiguration dataRegionCfg, boolean trackable, PageReadWriteManager pmPageMgr)booleanapplyDataEntry(GridCacheContext<?,?> cacheCtx, GridDhtLocalPartition locPart, DataEntry dataEntry)Applies data entry.voidapplyPageSnapshot(PageMemoryEx pageMem, PageSnapshot pageSnapshotRecord)voidapplyUpdatesOnRecovery(@Nullable WALIterator it, IgniteBiPredicate<WALPointer,WALRecord> recPredicate, IgnitePredicate<DataEntry> entryPredicate)Apply update from some iterator and with specific filters.voidbeforeExchange(GridDhtPartitionsExchangeFuture fut)booleancancelOrWaitPartitionDestroy(int grpId, int partId)Cancels or wait for partition destroy.protected voidcheckPageSize(DataStorageConfiguration memCfg)FilecheckpointDirectory()Collection<DataRegion>checkpointedDataRegions()@Nullable CheckpointHistorycheckpointHistory()booleancheckpointLockIsHeldByThread()voidcheckpointReadLock()Gets the checkpoint read lock.longcheckpointReadLockTimeout()Timeout for checkpoint read lock acquisition.voidcheckpointReadLockTimeout(long val)Sets timeout for checkpoint read lock acquisition.voidcheckpointReadUnlock()Releases the checkpoint read lock.protected voidcheckRegionEvictionProperties(DataRegionConfiguration regCfg, DataStorageConfiguration dbCfg)voidcleanupCheckpointDirectory()Clean checkpoint directoryCheckpointMarkersStorage.cpDir.voidcleanupRestoredCaches()Method will perform cleanup cache page memory and each cache partition store.voidcleanupTempCheckpointDirectory()Cleanup checkpoint directory from all temporary files.protected PageMemorycreatePageMemory(DirectMemoryProvider memProvider, DataStorageConfiguration dsCfg, DataRegionConfiguration regCfg, DataRegionMetricsImpl regMetrics, boolean trackable, PageReadWriteManager pageMgr)Creates PageMemory with given size and memory provider.protected DataRegionMetricsProviderdataRegionMetricsProvider(DataRegionConfiguration dataRegCfg)Provide that can be used to compute some metrics for provided data region.CachePartitionDefragmentationManagerdefragmentationManager()IgniteInternalFuture<Void>enableCheckpoints(boolean enable)For test use only.longforAllPageStores(ToLongFunction<PageStore> f)CheckpointProgressforceCheckpoint(String reason)Schedule a new checkpoint.<R> CheckpointProgressforceNewCheckpoint(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.longforGroupPageStores(CacheGroupContext gctx, ToLongFunction<PageStore> f)protected IgniteOutClosure<Long>freeSpaceProvider(DataRegionConfiguration dataRegCfg)Deprecated.CheckpointergetCheckpointer()@Nullable CheckpointManagergetCheckpointManager()FilePageStoreManagergetFileStoreManager()PageStoregetPageStore(int grpId, int partId)protected voidinitDataRegions(DataStorageConfiguration memCfg)protected voidinitDataRegions0(DataStorageConfiguration memCfg)booleanisCheckpointInapplicableForWalRebalance(Long cpTs, int grpId)Checks that checkpoint with timestampcpTsis inapplicable as start point for WAL rebalance for given groupgrpId.voidlastCheckpointInapplicableForWalRebalance(int grpId)Set last checkpoint as inapplicable for WAL rebalance for given groupgrpId.WALPointerlastCheckpointMarkWalPointer()WALPointerlatestWalPointerReservedForPreloading()Returns the latest WAL pointer that reserved for preloading ornull.MetaStoragemetaStorage()voidnotifyMetaStorageSubscribersOnReadyForRead()NotifiesMetastorageLifecycleListenerthatMetaStorageis ready for read.voidonActivate(GridKernalContext ctx)Called when cluster performing activation.voidonCacheGroupsStopped(Collection<IgniteBiTuple<CacheGroupContext,Boolean>> stoppedGrps)voidonDeActivate(GridKernalContext kctx)Called when cluster performing deactivation.protected voidonKernalStop0(boolean cancel)voidonStateRestored(AffinityTopologyVersion topVer)Called when all partitions have been fully restored and pre-created on node start.voidonWalTruncated(@Nullable WALPointer highBound)Wal truncate callback.AtomicLongpageListCacheLimitHolder(DataRegion dataRegion)booleanpreferWalRebalance()Returns true if historical rebalance is preferred, false means using heuristic for determine rebalance type.voidpreserveWalTailPointer()voidrebuildIndexesIfNeeded(GridDhtPartitionsExchangeFuture exchangeFut)voidreleaseHistoryForExchange()Release reserved update history.voidreleaseHistoryForPreloading()Release reserved update history.voidremoveCheckpointListener(CheckpointListener lsnr)Map<Integer,Map<Integer,Long>>reserveHistoryForExchange()Reserve update history for exchange.booleanreserveHistoryForPreloading(Map<T2<Integer,Integer>,Long> reservationMap)Reserve update history for preloading.voidresumeWalLogging()voidschedulePartitionDestroy(int grpId, int partId)Adds given partition to checkpointer destroy queue.voidsetThreadBuf(ThreadLocal<ByteBuffer> threadBuf)Replace thread local with buffers.protected voidstart0()voidstartMemoryRestore(GridKernalContext kctx, TimeBag startTimer)Perform memory restore beforeGridDiscoveryManagerstart.protected voidstop0(boolean cancel)voidstripedApplyPage(Consumer<PageMemoryEx> consumer, int grpId, int partId, CacheStripedExecutor exec)MetaStorage.TmpStoragetemporaryMetaStorage()voidtemporaryMetaStorage(MetaStorage.TmpStorage tmpMetaStorage)<R> voidwaitForCheckpoint(String reason, IgniteInClosure<? super IgniteInternalFuture<R>> lsnr)Waits until current state is checkpointed and execution listeners after finish.@Nullable IgniteInternalFuturewakeupForCheckpoint(String reason)booleanwalEnabled(int grpId, boolean local)voidwalEnabled(int grpId, boolean enabled, boolean local)Marks cache group as with disabled WAL.-
Methods inherited from class org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager
addDataRegion, buildAllocPath, buildPath, createPageEvictionTracker, dataRegion, dataRegions, dataStorageMetricsImpl, dumpStatistics, ensureFreeSpace, ensureFreeSpaceForInsert, freeList, getDatabaseListeners, initAndStartRegions, initPageMemoryDataStructures, memoryMetrics, memoryMetrics, pageSize, prepareCachesStop, reuseList, setPageSize, supportsMemoryReuse, systemDateRegionName, waitForCheckpoint
-
Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter
context, isStopping, kernalStartInfo, kernalStopInfo, onDisconnected, onKernalStart, onKernalStart0, onKernalStop, onReconnected, printMemoryStats, start, startInfo, stop, stopInfo, toString
-
-
-
-
Field Detail
-
IGNITE_PDS_CHECKPOINT_TEST_SKIP_SYNC
@SystemProperty("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
- See Also:
- Constant Field Values
-
IGNITE_PDS_SKIP_CHECKPOINT_ON_NODE_STOP
@SystemProperty("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
Skip checkpoint on node stop flag.- See Also:
- Constant Field Values
-
IGNITE_PDS_LOG_CP_READ_LOCK_HOLDERS
@SystemProperty("Enables log checkpoint read lock holders") public static final String IGNITE_PDS_LOG_CP_READ_LOCK_HOLDERS
Log read lock holders.- See Also:
- Constant Field Values
-
METASTORE_DATA_REGION_NAME
public static final String METASTORE_DATA_REGION_NAME
MemoryPolicyConfiguration name reserved for meta store.- See Also:
- Constant Field Values
-
METASTORE_VIEW
public static final String METASTORE_VIEW
Name of the system view for a systemMetaStorage.- See Also:
- Constant Field Values
-
METASTORE_VIEW_DESC
public static final String METASTORE_VIEW_DESC
Description of the system view for aMetaStorage.- See Also:
- Constant Field Values
-
DEFRAGMENTATION_PART_REGION_NAME
public static final String DEFRAGMENTATION_PART_REGION_NAME
- See Also:
- Constant Field Values
-
DEFRAGMENTATION_MAPPING_REGION_NAME
public static final String DEFRAGMENTATION_MAPPING_REGION_NAME
- See Also:
- Constant Field Values
-
DFLT_PDS_WAL_REBALANCE_THRESHOLD
public static final int DFLT_PDS_WAL_REBALANCE_THRESHOLD
-
DFLT_DEFRAGMENTATION_REGION_SIZE_PERCENTAGE
public static final int DFLT_DEFRAGMENTATION_REGION_SIZE_PERCENTAGE
-
HISTORICAL_REBALANCE_THRESHOLD_DMS_KEY
public static final String HISTORICAL_REBALANCE_THRESHOLD_DMS_KEY
WAL rebalance threshold distributed configuration key- See Also:
- Constant Field Values
-
checkpointedDataRegions
protected final Set<DataRegion> checkpointedDataRegions
Data regions which should be checkpointed.
-
-
Constructor Detail
-
GridCacheDatabaseSharedManager
public GridCacheDatabaseSharedManager(GridKernalContext ctx)
- Parameters:
ctx- Kernal context.
-
-
Method Detail
-
getFileStoreManager
public FilePageStoreManager getFileStoreManager()
- Returns:
- File store manager.
-
getCheckpointer
public Checkpointer getCheckpointer()
-
getCheckpointManager
@Nullable public @Nullable CheckpointManager getCheckpointManager()
- Returns:
- Checkpoint manager or
nullif this node is a client node.
-
preferWalRebalance
public boolean preferWalRebalance()
Returns true if historical rebalance is preferred, false means using heuristic for determine rebalance type.- Returns:
- Flag of preferred historical rebalance.
-
enableCheckpoints
public IgniteInternalFuture<Void> enableCheckpoints(boolean enable)
For test use only.
-
initDataRegions0
protected void initDataRegions0(DataStorageConfiguration memCfg) throws IgniteCheckedException
- Overrides:
initDataRegions0in classIgniteCacheDatabaseSharedManager- Parameters:
memCfg- Database config.- Throws:
IgniteCheckedException- If failed to initialize swap path.
-
start0
protected void start0() throws IgniteCheckedException- Overrides:
start0in classIgniteCacheDatabaseSharedManager- Throws:
IgniteCheckedException- If failed.
-
initDataRegions
protected void initDataRegions(DataStorageConfiguration memCfg) throws IgniteCheckedException
- Overrides:
initDataRegionsin classIgniteCacheDatabaseSharedManager- Parameters:
memCfg- Database config.- Throws:
IgniteCheckedException- If failed to initialize swap path.
-
checkpointedDataRegions
public Collection<DataRegion> checkpointedDataRegions()
-
cleanupTempCheckpointDirectory
public void cleanupTempCheckpointDirectory() throws IgniteCheckedExceptionCleanup checkpoint directory from all temporary files.- Overrides:
cleanupTempCheckpointDirectoryin classIgniteCacheDatabaseSharedManager- Throws:
IgniteCheckedException
-
cleanupRestoredCaches
public void cleanupRestoredCaches()
Method will perform cleanup cache page memory and each cache partition store.- Overrides:
cleanupRestoredCachesin classIgniteCacheDatabaseSharedManager
-
cleanupCheckpointDirectory
public void cleanupCheckpointDirectory() throws IgniteCheckedExceptionClean checkpoint directoryCheckpointMarkersStorage.cpDir. The operation is necessary when local node joined to baseline topology with different consistentId.- Overrides:
cleanupCheckpointDirectoryin classIgniteCacheDatabaseSharedManager- Throws:
IgniteCheckedException
-
defragmentationManager
public CachePartitionDefragmentationManager defragmentationManager()
-
addDataRegion
public DataRegion addDataRegion(DataStorageConfiguration dataStorageCfg, DataRegionConfiguration dataRegionCfg, boolean trackable, PageReadWriteManager pmPageMgr) throws IgniteCheckedException
- Overrides:
addDataRegionin classIgniteCacheDatabaseSharedManager- Parameters:
dataStorageCfg- Database config.dataRegionCfg- Data region config.pmPageMgr- Page manager.- Throws:
IgniteCheckedException- If failed to initialize swap path.
-
onActivate
public void onActivate(GridKernalContext ctx) throws IgniteCheckedException
Called when cluster performing activation.- Specified by:
onActivatein interfaceIgniteChangeGlobalStateSupport- Overrides:
onActivatein classIgniteCacheDatabaseSharedManager- Parameters:
ctx- Kernal context.- Throws:
IgniteCheckedException- If failed.
-
onDeActivate
public void onDeActivate(GridKernalContext kctx)
Called when cluster performing deactivation.- Specified by:
onDeActivatein interfaceIgniteChangeGlobalStateSupport- Overrides:
onDeActivatein classIgniteCacheDatabaseSharedManager- Parameters:
kctx- Kernal context.
-
freeSpaceProvider
@Deprecated protected IgniteOutClosure<Long> freeSpaceProvider(DataRegionConfiguration dataRegCfg)
Deprecated.Closure that can be used to compute fill factor for provided data region.- Overrides:
freeSpaceProviderin classIgniteCacheDatabaseSharedManager- Parameters:
dataRegCfg- Data region configuration.- Returns:
- Closure.
-
dataRegionMetricsProvider
protected DataRegionMetricsProvider dataRegionMetricsProvider(DataRegionConfiguration dataRegCfg)
Provide that can be used to compute some metrics for provided data region.- Overrides:
dataRegionMetricsProviderin classIgniteCacheDatabaseSharedManager- Parameters:
dataRegCfg- Data region configuration.- Returns:
- DataRegionMetricsProvider.
-
onKernalStop0
protected void onKernalStop0(boolean cancel)
- Overrides:
onKernalStop0in classGridCacheSharedManagerAdapter- Parameters:
cancel- Cancel flag.
-
stop0
protected void stop0(boolean cancel)
- Overrides:
stop0in classIgniteCacheDatabaseSharedManager- Parameters:
cancel- Cancel flag.
-
createPageMemory
protected PageMemory createPageMemory(DirectMemoryProvider memProvider, DataStorageConfiguration dsCfg, DataRegionConfiguration regCfg, DataRegionMetricsImpl regMetrics, boolean trackable, PageReadWriteManager pageMgr)
Creates PageMemory with given size and memory provider.- Overrides:
createPageMemoryin classIgniteCacheDatabaseSharedManager- Parameters:
memProvider- Direct memory provider.dsCfg- Data storage configuration.regCfg- Data region configuration.regMetrics- Data region metrics to collect memory usage metrics.pageMgr- Page read/write manager.- Returns:
- PageMemory instance.
-
checkRegionEvictionProperties
protected void checkRegionEvictionProperties(DataRegionConfiguration regCfg, DataStorageConfiguration dbCfg) throws IgniteCheckedException
- Overrides:
checkRegionEvictionPropertiesin classIgniteCacheDatabaseSharedManager- Parameters:
regCfg- DataRegionConfiguration to validate.dbCfg- Memory configuration.- Throws:
IgniteCheckedException- If config is invalid.
-
checkPageSize
protected void checkPageSize(DataStorageConfiguration memCfg)
- Overrides:
checkPageSizein classIgniteCacheDatabaseSharedManager- Parameters:
memCfg- Memory config.
-
beforeExchange
public void beforeExchange(GridDhtPartitionsExchangeFuture fut) throws IgniteCheckedException
- Overrides:
beforeExchangein classIgniteCacheDatabaseSharedManager- Parameters:
fut- Before exchange for the given discovery event.- Throws:
IgniteCheckedException
-
rebuildIndexesIfNeeded
public void rebuildIndexesIfNeeded(GridDhtPartitionsExchangeFuture exchangeFut)
- Overrides:
rebuildIndexesIfNeededin classIgniteCacheDatabaseSharedManager- Parameters:
exchangeFut- Partition exchange future.
-
forceRebuildIndexes
public Collection<GridCacheContext> forceRebuildIndexes(Collection<GridCacheContext> contexts)
Initiate an asynchronous forced index rebuild for caches.- Overrides:
forceRebuildIndexesin classIgniteCacheDatabaseSharedManager- Parameters:
contexts- Cache contexts.- Returns:
- Cache contexts for which index rebuilding is not initiated by this call because they are already in the process of rebuilding.
-
onCacheGroupsStopped
public void onCacheGroupsStopped(Collection<IgniteBiTuple<CacheGroupContext,Boolean>> stoppedGrps)
- Overrides:
onCacheGroupsStoppedin classIgniteCacheDatabaseSharedManager- Parameters:
stoppedGrps- A collection of tuples (cache group, destroy flag).
-
checkpointReadLock
public void checkpointReadLock()
Gets the checkpoint read lock. While this lock is held, checkpoint thread will not acquireSnapshotWorker memory state.- Overrides:
checkpointReadLockin classIgniteCacheDatabaseSharedManager- Throws:
IgniteException- If failed.
-
checkpointLockIsHeldByThread
public boolean checkpointLockIsHeldByThread()
- Specified by:
checkpointLockIsHeldByThreadin interfaceCheckpointLockStateChecker- Overrides:
checkpointLockIsHeldByThreadin classIgniteCacheDatabaseSharedManager- Returns:
- true if checkpoint lock is held by current thread
-
checkpointReadUnlock
public void checkpointReadUnlock()
Releases the checkpoint read lock.- Overrides:
checkpointReadUnlockin classIgniteCacheDatabaseSharedManager
-
reserveHistoryForExchange
public Map<Integer,Map<Integer,Long>> reserveHistoryForExchange()
Reserve update history for exchange.- Overrides:
reserveHistoryForExchangein classIgniteCacheDatabaseSharedManager- Returns:
- Reserved update counters per cache and partition.
-
releaseHistoryForExchange
public void releaseHistoryForExchange()
Release reserved update history.- Overrides:
releaseHistoryForExchangein classIgniteCacheDatabaseSharedManager
-
reserveHistoryForPreloading
public boolean reserveHistoryForPreloading(Map<T2<Integer,Integer>,Long> reservationMap)
Reserve update history for preloading.- Overrides:
reserveHistoryForPreloadingin classIgniteCacheDatabaseSharedManager- Parameters:
reservationMap- Map contains of counters for partitions of groups.- Returns:
- True if successfully reserved.
-
releaseHistoryForPreloading
public void releaseHistoryForPreloading()
Release reserved update history.- Overrides:
releaseHistoryForPreloadingin classIgniteCacheDatabaseSharedManager
-
latestWalPointerReservedForPreloading
public WALPointer latestWalPointerReservedForPreloading()
Returns the latest WAL pointer that reserved for preloading ornull.- Overrides:
latestWalPointerReservedForPreloadingin classIgniteCacheDatabaseSharedManager- Returns:
- WAL pointer or
nullif nothing reserved.
-
wakeupForCheckpoint
@Nullable public @Nullable IgniteInternalFuture wakeupForCheckpoint(String reason)
- Overrides:
wakeupForCheckpointin classIgniteCacheDatabaseSharedManager
-
waitForCheckpoint
public <R> void waitForCheckpoint(String reason, IgniteInClosure<? super IgniteInternalFuture<R>> lsnr) throws IgniteCheckedException
Waits until current state is checkpointed and execution listeners after finish.- Overrides:
waitForCheckpointin classIgniteCacheDatabaseSharedManager- Parameters:
reason- Reason for checkpoint wakeup if it would be required.lsnr- Listeners which should be called in checkpoint thread after current checkpoint finished.- Throws:
IgniteCheckedException- If failed.
-
forceCheckpoint
public CheckpointProgress forceCheckpoint(String reason)
Schedule a new checkpoint.Note: if a checkpoint is already running and the locks have not been taken yet, then a new checkpoint will not be forced.
- Overrides:
forceCheckpointin classIgniteCacheDatabaseSharedManager- Parameters:
reason- Reason.
-
forceNewCheckpoint
public <R> CheckpointProgress forceNewCheckpoint(String reason, IgniteInClosure<? super IgniteInternalFuture<R>> lsnr)
Schedule a new checkpoint.- Overrides:
forceNewCheckpointin classIgniteCacheDatabaseSharedManager- Parameters:
reason- Reason.lsnr- Listener which will be called on scheduled checkpoint finish.
-
lastCheckpointMarkWalPointer
public WALPointer lastCheckpointMarkWalPointer()
- Overrides:
lastCheckpointMarkWalPointerin classIgniteCacheDatabaseSharedManager- Returns:
- Last checkpoint mark WAL pointer.
-
checkpointDirectory
public File checkpointDirectory()
- Returns:
- Checkpoint directory.
-
addCheckpointListener
public void addCheckpointListener(CheckpointListener lsnr, DataRegion dataRegion)
- Parameters:
lsnr- Listener.dataRegion- Data region for which listener is corresponded to.
-
addCheckpointListener
public void addCheckpointListener(CheckpointListener lsnr)
- Parameters:
lsnr- Listener.
-
removeCheckpointListener
public void removeCheckpointListener(CheckpointListener lsnr)
- Parameters:
lsnr- Listener.
-
startMemoryRestore
public void startMemoryRestore(GridKernalContext kctx, TimeBag startTimer) throws IgniteCheckedException
Perform memory restore beforeGridDiscoveryManagerstart.- Overrides:
startMemoryRestorein classIgniteCacheDatabaseSharedManager- Parameters:
kctx- Current kernal context.startTimer- Holder of start time of stages.- Throws:
IgniteCheckedException- If fails.
-
resumeWalLogging
public void resumeWalLogging() throws IgniteCheckedException- Throws:
IgniteCheckedException
-
preserveWalTailPointer
public void preserveWalTailPointer() throws IgniteCheckedException- Throws:
IgniteCheckedException
-
getPageStore
public PageStore getPageStore(int grpId, int partId) throws IgniteCheckedException
- Parameters:
grpId- Cache group id.partId- Partition ID.- Returns:
- Page store.
- Throws:
IgniteCheckedException- If failed.
-
forGroupPageStores
public long forGroupPageStores(CacheGroupContext gctx, ToLongFunction<PageStore> f)
- Parameters:
gctx- Group context.f- Consumer.- Returns:
- Accumulated result for all page stores.
-
forAllPageStores
public long forAllPageStores(ToLongFunction<PageStore> f)
- Parameters:
f- Consumer.- Returns:
- Accumulated result for all page stores.
-
onStateRestored
public void onStateRestored(AffinityTopologyVersion topVer) throws IgniteCheckedException
Called when all partitions have been fully restored and pre-created on node start. Starts checkpointing process and initiates first checkpoint.- Overrides:
onStateRestoredin classIgniteCacheDatabaseSharedManager- Throws:
IgniteCheckedException- If first checkpoint has failed.
-
stripedApplyPage
public void stripedApplyPage(Consumer<PageMemoryEx> consumer, int grpId, int partId, CacheStripedExecutor exec) throws IgniteCheckedException
- Parameters:
consumer- Runnable task.grpId- Group Id.partId- Partition Id.exec- Striped executor.- Throws:
IgniteCheckedException
-
applyPageSnapshot
public void applyPageSnapshot(PageMemoryEx pageMem, PageSnapshot pageSnapshotRecord) throws IgniteCheckedException
- Parameters:
pageMem- Page memory.pageSnapshotRecord- Page snapshot record.- Throws:
IgniteCheckedException- If failed.
-
applyUpdatesOnRecovery
public void applyUpdatesOnRecovery(@Nullable @Nullable WALIterator it, IgniteBiPredicate<WALPointer,WALRecord> recPredicate, IgnitePredicate<DataEntry> entryPredicate) throws IgniteCheckedExceptionApply update from some iterator and with specific filters.- Parameters:
it- WalIterator.recPredicate- Wal record filter.entryPredicate- Entry filter.- Throws:
IgniteCheckedException
-
onWalTruncated
public void onWalTruncated(@Nullable @Nullable WALPointer highBound) throws IgniteCheckedExceptionWal truncate callback.- Overrides:
onWalTruncatedin classIgniteCacheDatabaseSharedManager- Parameters:
highBound- Upper bound.- Throws:
IgniteCheckedException- If failed.
-
applyDataEntry
public boolean applyDataEntry(GridCacheContext<?,?> cacheCtx, GridDhtLocalPartition locPart, DataEntry dataEntry) throws IgniteCheckedException
Applies data entry.- Parameters:
cacheCtx- Cache context.locPart- Local partition.dataEntry- Data entry.- Returns:
trueif entry has applied, otherwisefalse.- Throws:
IgniteCheckedException
-
setThreadBuf
public void setThreadBuf(ThreadLocal<ByteBuffer> threadBuf)
Replace thread local with buffers. Thread local should provide direct buffer with one page in length.- Parameters:
threadBuf- new thread-local with buffers for the checkpoint threads.
-
checkpointHistory
@Nullable public @Nullable CheckpointHistory checkpointHistory()
- Returns:
- Checkpoint history.
-
schedulePartitionDestroy
public void schedulePartitionDestroy(int grpId, int partId)Adds given partition to checkpointer destroy queue.- Parameters:
grpId- Group ID.partId- Partition ID.
-
cancelOrWaitPartitionDestroy
public boolean cancelOrWaitPartitionDestroy(int grpId, int partId) throws IgniteCheckedExceptionCancels or wait for partition destroy.- Parameters:
grpId- Group ID.partId- Partition ID.- Returns:
Trueif the request to destroy the partition was canceled.- Throws:
IgniteCheckedException- If failed.
-
checkpointReadLockTimeout
public long checkpointReadLockTimeout()
Timeout for checkpoint read lock acquisition.- Overrides:
checkpointReadLockTimeoutin classIgniteCacheDatabaseSharedManager- Returns:
- Timeout for checkpoint read lock acquisition in milliseconds.
-
checkpointReadLockTimeout
public void checkpointReadLockTimeout(long val)
Sets timeout for checkpoint read lock acquisition.- Overrides:
checkpointReadLockTimeoutin classIgniteCacheDatabaseSharedManager- Parameters:
val- New timeout in milliseconds, non-positive value denotes infinite timeout.
-
pageListCacheLimitHolder
public AtomicLong pageListCacheLimitHolder(DataRegion dataRegion)
- Returns:
- Holder for page list cache limit for given data region.
-
metaStorage
public MetaStorage metaStorage()
- Overrides:
metaStoragein classIgniteCacheDatabaseSharedManager- Returns:
- MetaStorage
-
temporaryMetaStorage
public MetaStorage.TmpStorage temporaryMetaStorage()
- Returns:
- Temporary metastorage to migration of index partition.
-
temporaryMetaStorage
public void temporaryMetaStorage(MetaStorage.TmpStorage tmpMetaStorage)
- Parameters:
tmpMetaStorage- Temporary metastorage to migration of index partition.
-
notifyMetaStorageSubscribersOnReadyForRead
public void notifyMetaStorageSubscribersOnReadyForRead() throws IgniteCheckedExceptionNotifiesMetastorageLifecycleListenerthatMetaStorageis ready for read. This method is called when all processors and managers have already started and right before discovery manager.- Overrides:
notifyMetaStorageSubscribersOnReadyForReadin classIgniteCacheDatabaseSharedManager- Throws:
IgniteCheckedException- If failed.
-
walEnabled
public boolean walEnabled(int grpId, boolean local)- Overrides:
walEnabledin classIgniteCacheDatabaseSharedManager- Parameters:
grpId- Group ID.- Returns:
- WAL enabled flag.
-
walEnabled
public void walEnabled(int grpId, boolean enabled, boolean local)Marks cache group as with disabled WAL.- Overrides:
walEnabledin classIgniteCacheDatabaseSharedManager- Parameters:
grpId- Group id.enabled- flag.
-
isCheckpointInapplicableForWalRebalance
public boolean isCheckpointInapplicableForWalRebalance(Long cpTs, int grpId) throws IgniteCheckedException
Checks that checkpoint with timestampcpTsis inapplicable as start point for WAL rebalance for given groupgrpId.- Parameters:
cpTs- Checkpoint timestamp.grpId- Group ID.- Returns:
trueif checkpointcpTsis inapplicable as start point for WAL rebalance forgrpId.- Throws:
IgniteCheckedException- If failed to check.
-
lastCheckpointInapplicableForWalRebalance
public void lastCheckpointInapplicableForWalRebalance(int grpId)
Set last checkpoint as inapplicable for WAL rebalance for given groupgrpId.- Overrides:
lastCheckpointInapplicableForWalRebalancein classIgniteCacheDatabaseSharedManager- Parameters:
grpId- Group ID.
-
-