public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedManager implements CheckpointWriteProgressSupplier
| Modifier and Type | Class and Description |
|---|---|
static class |
GridCacheDatabaseSharedManager.Checkpoint |
class |
GridCacheDatabaseSharedManager.Checkpointer
Checkpointer object is used for notification on checkpoint begin, predicate is
GridCacheDatabaseSharedManager.Checkpointer.scheduledCp.nextCpTs - now
> 0 . |
static class |
GridCacheDatabaseSharedManager.FileLockHolder |
static class |
GridCacheDatabaseSharedManager.RestoreBinaryState
Restore memory context.
|
static class |
GridCacheDatabaseSharedManager.RestoreLogicalState
Restore logical state context.
|
static class |
GridCacheDatabaseSharedManager.RestoreStateContext
Abstract class for create restore context.
|
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
CP_FILE_NAME_PATTERN
Checkpoint file name pattern.
|
static String |
IGNITE_PDS_CHECKPOINT_TEST_SKIP_SYNC |
static String |
METASTORE_DATA_REGION_NAME
MemoryPolicyConfiguration name reserved for meta store.
|
static String |
NODE_STARTED_FILE_NAME_SUFFIX
Node started file suffix.
|
dataRegionMap, dfltDataRegion, freeListMap, memMetricsMap, SYSTEM_DATA_REGION_NAMEcctx, diagnosticLog, log| Constructor and Description |
|---|
GridCacheDatabaseSharedManager(GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCheckpointListener(DbCheckpointListener lsnr) |
void |
applyUpdatesOnRecovery(WALIterator it,
IgnitePredicate<IgniteBiTuple<WALPointer,WALRecord>> recPredicate,
IgnitePredicate<DataEntry> entryPredicate,
Map<T2<Integer,Integer>,T2<Integer,Long>> partStates)
Apply update from some iterator and with specific filters.
|
boolean |
beforeExchange(GridDhtPartitionsExchangeFuture fut) |
void |
cancelOrWaitPartitionDestroy(int grpId,
int partId)
Cancels or wait for partition destroy.
|
protected void |
checkPageSize(DataStorageConfiguration memCfg) |
File |
checkpointDirectory() |
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()
Cleanup checkpoint directory.
|
void |
cleanupTempCheckpointDirectory()
Cleanup checkpoint directory from all temporary files.
|
CheckpointEntry |
createCheckPointEntry(long cpTs,
WALPointer ptr,
UUID cpId,
CheckpointRecord rec,
CheckpointEntryType type) |
protected PageMemory |
createPageMemory(DirectMemoryProvider memProvider,
DataStorageConfiguration memCfg,
DataRegionConfiguration plcCfg,
DataRegionMetricsImpl memMetrics,
boolean trackable)
Creates PageMemory with given size and memory provider.
|
int |
currentCheckpointPagesCount() |
IgniteInternalFuture<Void> |
enableCheckpoints(boolean enable)
For test use only.
|
AtomicInteger |
evictedPagesCntr() |
CheckpointFuture |
forceCheckpoint(String reason)
Allows to wait checkpoint finished.
|
protected IgniteOutClosure<Long> |
freeSpaceProvider(DataRegionConfiguration dataRegCfg)
Closure that can be used to compute fill factor for provided data region.
|
GridCacheDatabaseSharedManager.Checkpointer |
getCheckpointer() |
IgniteInternalFuture |
indexRebuildFuture(int cacheId) |
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() |
MetaStorage |
metaStorage() |
List<T2<Long,WALPointer>> |
nodeStartedPointers()
Collects memory recovery pointers from node started files.
|
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()
Called when all partitions have been fully restored and pre-created on node start.
|
void |
onWalTruncated(WALPointer highBound)
Wal truncate callBack.
|
DataStorageMetrics |
persistentStoreMetrics() |
DataStorageMetricsImpl |
persistentStoreMetricsImpl() |
void |
readCheckpointAndRestoreMemory(List<DynamicCacheDescriptor> cachesToStart) |
void |
rebuildIndexesIfNeeded(GridDhtPartitionsExchangeFuture fut) |
void |
releaseHistoryForExchange()
Release reserved update history.
|
void |
releaseHistoryForPreloading()
Release reserved update history.
|
void |
removeCheckpointListener(DbCheckpointListener lsnr) |
Map<Integer,Map<Integer,Long>> |
reserveHistoryForExchange()
Reserve update history for exchange.
|
boolean |
reserveHistoryForPreloading(int grpId,
int partId,
long cntr)
Reserve update history for preloading.
|
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() |
protected void |
stop0(boolean cancel) |
AtomicInteger |
syncedPagesCounter() |
void |
waitForCheckpoint(String reason)
Waits until current state is checkpointed.
|
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.
|
protected DirectMemoryProvider |
wrapMetricsMemoryProvider(DirectMemoryProvider memoryProvider0,
DataRegionMetricsImpl memMetrics) |
void |
writeCheckpointEntry(ByteBuffer entryBuf,
CheckpointEntry cp,
CheckpointEntryType type)
Writes checkpoint entry buffer
entryBuf to specified checkpoint file with 2-phase protocol. |
AtomicInteger |
writtenPagesCounter()
Counter for written checkpoint pages.
|
addDataRegion, buildAllocPath, buildPath, createPageEvictionTracker, dataRegion, dataRegions, dumpStatistics, ensureFreeSpace, freeList, getDatabaseListeners, initDataRegions, initPageMemoryDataStructures, memoryMetrics, memoryMetrics, pageSize, prepareCachesStop, reuseList, setPageSize, systemDateRegionNamecontext, isStopping, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStop, onReconnected, printMemoryStats, start, startInfo, stop, stopInfo, toStringpublic static final String IGNITE_PDS_CHECKPOINT_TEST_SKIP_SYNC
public static final String METASTORE_DATA_REGION_NAME
public static final Pattern CP_FILE_NAME_PATTERN
public static final String NODE_STARTED_FILE_NAME_SUFFIX
public GridCacheDatabaseSharedManager(GridKernalContext ctx)
ctx - Kernal context.public GridCacheDatabaseSharedManager.Checkpointer getCheckpointer()
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.public void cleanupTempCheckpointDirectory()
throws IgniteCheckedException
cleanupTempCheckpointDirectory in class IgniteCacheDatabaseSharedManagerIgniteCheckedExceptionpublic void cleanupCheckpointDirectory()
throws IgniteCheckedException
cleanupCheckpointDirectory in class IgniteCacheDatabaseSharedManagerIgniteCheckedExceptionpublic 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 IgniteOutClosure<Long> freeSpaceProvider(DataRegionConfiguration dataRegCfg)
freeSpaceProvider in class IgniteCacheDatabaseSharedManagerdataRegCfg - Data region configuration.public void readCheckpointAndRestoreMemory(List<DynamicCacheDescriptor> cachesToStart) throws IgniteCheckedException
readCheckpointAndRestoreMemory in class IgniteCacheDatabaseSharedManagercachesToStart - Started caches.IgniteCheckedException - If failed.public List<T2<Long,WALPointer>> nodeStartedPointers() throws IgniteCheckedException
nodeStart(WALPointer).
Each pointer associated with timestamp extracted from file.
Tuples are sorted by timestamp.IgniteCheckedException - If failed.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)
createPageMemory in class IgniteCacheDatabaseSharedManagermemProvider - Memory provider.memCfg - Memory configuartion.plcCfg - data region configuration.memMetrics - DataRegionMetrics to collect memory usage metrics.protected DirectMemoryProvider wrapMetricsMemoryProvider(DirectMemoryProvider memoryProvider0, DataRegionMetricsImpl memMetrics)
wrapMetricsMemoryProvider in class IgniteCacheDatabaseSharedManagermemoryProvider0 - Memory provider.memMetrics - Memory metrics.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 boolean beforeExchange(GridDhtPartitionsExchangeFuture fut) throws IgniteCheckedException
beforeExchange in class IgniteCacheDatabaseSharedManagerfut - Before exchange for the given discovery event.True if partitions have been restored from persistent storage.IgniteCheckedExceptionpublic void rebuildIndexesIfNeeded(GridDhtPartitionsExchangeFuture fut)
rebuildIndexesIfNeeded in class IgniteCacheDatabaseSharedManagerfut - Partition exchange future.@Nullable public IgniteInternalFuture indexRebuildFuture(int cacheId)
indexRebuildFuture in class IgniteCacheDatabaseSharedManagerpublic 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 void onStateRestored()
throws IgniteCheckedException
onStateRestored in class IgniteCacheDatabaseSharedManagerIgniteCheckedException - If first checkpoint has failed.public Map<Integer,Map<Integer,Long>> reserveHistoryForExchange()
reserveHistoryForExchange in class IgniteCacheDatabaseSharedManagerpublic void releaseHistoryForExchange()
releaseHistoryForExchange in class IgniteCacheDatabaseSharedManagerpublic boolean reserveHistoryForPreloading(int grpId,
int partId,
long cntr)
reserveHistoryForPreloading in class IgniteCacheDatabaseSharedManagergrpId - Cache group ID.partId - Partition Id.cntr - Update counter.public void releaseHistoryForPreloading()
releaseHistoryForPreloading in class IgniteCacheDatabaseSharedManager@Nullable public IgniteInternalFuture wakeupForCheckpoint(String reason)
wakeupForCheckpoint in class IgniteCacheDatabaseSharedManagerpublic void waitForCheckpoint(String reason) throws IgniteCheckedException
waitForCheckpoint in class IgniteCacheDatabaseSharedManagerIgniteCheckedException - If failed.public CheckpointFuture forceCheckpoint(String reason)
forceCheckpoint in class IgniteCacheDatabaseSharedManagerreason - Reason.public WALPointer lastCheckpointMarkWalPointer()
lastCheckpointMarkWalPointer in class IgniteCacheDatabaseSharedManagerpublic File checkpointDirectory()
public void addCheckpointListener(DbCheckpointListener lsnr)
lsnr - Listener.public void removeCheckpointListener(DbCheckpointListener lsnr)
lsnr - Listener.public void applyUpdatesOnRecovery(@Nullable
WALIterator it,
IgnitePredicate<IgniteBiTuple<WALPointer,WALRecord>> recPredicate,
IgnitePredicate<DataEntry> entryPredicate,
Map<T2<Integer,Integer>,T2<Integer,Long>> partStates)
throws IgniteCheckedException
it - WalIterator.recPredicate - Wal record filter.entryPredicate - Entry filter.partStates - Partition to restore state.IgniteCheckedExceptionpublic void onWalTruncated(WALPointer highBound) throws IgniteCheckedException
highBound - WALPointer.IgniteCheckedExceptionpublic void writeCheckpointEntry(ByteBuffer entryBuf, CheckpointEntry cp, CheckpointEntryType type) throws StorageException
entryBuf to specified checkpoint file with 2-phase protocol.entryBuf - Checkpoint entry buffer to write.cp - Checkpoint entry.type - Checkpoint entry type.StorageException - If failed to write checkpoint entry.public AtomicInteger writtenPagesCounter()
writtenPagesCounter in interface CheckpointWriteProgressSupplierpublic AtomicInteger syncedPagesCounter()
syncedPagesCounter in interface CheckpointWriteProgressSupplierpublic AtomicInteger evictedPagesCntr()
evictedPagesCntr in interface CheckpointWriteProgressSupplierpublic int currentCheckpointPagesCount()
currentCheckpointPagesCount in interface CheckpointWriteProgressSupplierpublic void setThreadBuf(ThreadLocal<ByteBuffer> threadBuf)
threadBuf - new thread-local with buffers for the checkpoint threads.public CheckpointEntry createCheckPointEntry(long cpTs, WALPointer ptr, UUID cpId, @Nullable CheckpointRecord rec, CheckpointEntryType type)
cpTs - Checkpoint timestamp.ptr - Wal pointer of checkpoint.cpId - Checkpoint ID.rec - Checkpoint record.type - Checkpoint type.@Nullable public CheckpointHistory checkpointHistory()
public void schedulePartitionDestroy(int grpId,
int partId)
grpId - Group ID.partId - Partition ID.public void cancelOrWaitPartitionDestroy(int grpId,
int partId)
throws IgniteCheckedException
grpId - Group ID.partId - Partition ID.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 DataStorageMetrics persistentStoreMetrics()
persistentStoreMetrics in class IgniteCacheDatabaseSharedManagernull otherwise.public DataStorageMetricsImpl persistentStoreMetricsImpl()
public MetaStorage metaStorage()
metaStorage in class IgniteCacheDatabaseSharedManagerpublic 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.7.5 Release Date : June 4 2019