org.apache.ignite.internal.processors.cache.persistence

## 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
`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.CheckpointStatus`
`static class` `GridCacheDatabaseSharedManager.FileLockHolder`
`class` `GridCacheDatabaseSharedManager.RestoreBinaryState` Restore memory context.
`class` `GridCacheDatabaseSharedManager.RestoreLogicalState` Restore logical state context.

### Field Summary

Fields
`static Pattern` `CP_FILE_NAME_PATTERN` Checkpoint file name pattern.
`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`
`static String` `METASTORE_DATA_REGION_NAME` MemoryPolicyConfiguration name reserved for meta store.

### Fields inherited from class org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager

`DATA_REGION_PAGE_LIST_VIEW, DATA_REGION_PAGE_LIST_VIEW_DESC, dataRegionMap, dfltDataRegion, freeListMap, INTERNAL_DATA_REGION_NAMES, memMetricsMap, reuseMemory, SYSTEM_DATA_REGION_NAME`

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter

`cctx, diagnosticLog, log`

### Constructor Summary

Constructors
Constructor and Description
`GridCacheDatabaseSharedManager(GridKernalContext ctx)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
`void` `addCheckpointListener(DbCheckpointListener lsnr)`
`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)`
`void` `cancelOrWaitPartitionDestroy(int grpId, int partId)` Cancels or wait for partition destroy.
`protected void` `checkPageSize(DataStorageConfiguration memCfg)`
`File` `checkpointDirectory()`
`IgniteThread` `checkpointerThread()` For test use only.
`static String` `checkpointFileName(CheckpointEntry cp, CheckpointEntryType type)`
`@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 `cpDir`.
`void` `cleanupRestoredCaches()` Method will perform cleanup cache page memory and each cache partition store.
`void` `cleanupTempCheckpointDirectory()` Cleanup checkpoint directory from all temporary files.
`CheckpointEntry` `createCheckPointEntry(long cpTs, WALPointer ptr, UUID cpId, @Nullable 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.
`protected DataRegionMetricsProvider` `dataRegionMetricsProvider(DataRegionConfiguration dataRegCfg)` Provide that can be used to compute some metrics for provided data region.
`IgniteInternalFuture<Void>` `enableCheckpoints(boolean enable)` For test use only.
`long` `forAllPageStores(ToLongFunction<PageStore> f)`
`CheckpointProgress` `forceCheckpoint(String reason)` Allows to wait checkpoint finished.
`long` `forGroupPageStores(CacheGroupContext gctx, ToLongFunction<PageStore> f)`
`protected IgniteOutClosure<Long>` `freeSpaceProvider(DataRegionConfiguration dataRegCfg)` Deprecated.
`GridCacheDatabaseSharedManager.Checkpointer` `getCheckpointer()`
`FilePageStoreManager` `getFileStoreManager()`
`PageStore` `getPageStore(int grpId, int partId)`
`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()`
`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(WALPointer highBound)` Wal truncate callBack.
`AtomicLong` `pageListCacheLimitHolder(DataRegion dataRegion)`
`DataStorageMetrics` `persistentStoreMetrics()`
`DataStorageMetricsImpl` `persistentStoreMetricsImpl()`
`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(DbCheckpointListener 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` `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.
`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.

### Methods inherited from class org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager

`addDataRegion, buildAllocPath, buildPath, createPageEvictionTracker, dataRegion, dataRegions, dumpStatistics, ensureFreeSpace, ensureFreeSpaceForInsert, freeList, getDatabaseListeners, initAndStartRegions, initDataRegions, initPageMemoryDataStructures, memoryMetrics, memoryMetrics, pageSize, prepareCachesStop, registerMetricsMBean, reuseList, setPageSize, supportsMemoryReuse, systemDateRegionName, unregisterMetricsMBean, waitForCheckpoint`

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter

`context, isStopping, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStart, onKernalStart0, onKernalStop, onReconnected, printMemoryStats, start, startInfo, stop, stopInfo, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### IGNITE_PDS_CHECKPOINT_TEST_SKIP_SYNC

    public static final String IGNITE_PDS_CHECKPOINT_TEST_SKIP_SYNC

See Also:
  Constant Field Values

#### IGNITE_PDS_SKIP_CHECKPOINT_ON_NODE_STOP

    public static final String IGNITE_PDS_SKIP_CHECKPOINT_ON_NODE_STOP

See Also:
  Constant Field Values

#### IGNITE_PDS_LOG_CP_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

#### CP_FILE_NAME_PATTERN

    public static final Pattern CP_FILE_NAME_PATTERN

Checkpoint file name pattern.

### Constructor Detail

#### GridCacheDatabaseSharedManager

    public GridCacheDatabaseSharedManager(GridKernalContext ctx)

Parameters:
  `ctx` - Kernal context.

### Method Detail

#### getFileStoreManager

    public FilePageStoreManager getFileStoreManager()

Returns:
  File store manager.

#### getCheckpointer

    public GridCacheDatabaseSharedManager.Checkpointer getCheckpointer()

#### checkpointerThread

    public IgniteThread checkpointerThread()

For test use only.

Returns:
  Checkpointer thread instance.

#### enableCheckpoints

    public IgniteInternalFuture<Void> enableCheckpoints(boolean enable)

For test use only.

#### initDataRegions0

    protected void initDataRegions0(DataStorageConfiguration memCfg)
                             throws IgniteCheckedException

Overrides:
  `initDataRegions0` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `memCfg` - Database config.
Throws:
  `IgniteCheckedException` - If failed to initialize swap path.

#### start0

    protected void start0()
                   throws IgniteCheckedException

Overrides:
  `start0` in class `IgniteCacheDatabaseSharedManager`
Throws:
  `IgniteCheckedException` - If failed.

#### cleanupTempCheckpointDirectory

    public void cleanupTempCheckpointDirectory()
                                        throws IgniteCheckedException

Cleanup checkpoint directory from all temporary files.

Overrides:
  `cleanupTempCheckpointDirectory` in class `IgniteCacheDatabaseSharedManager`
Throws:
  `IgniteCheckedException`

#### cleanupRestoredCaches

    public void cleanupRestoredCaches()

Method will perform cleanup cache page memory and each cache partition store.

Overrides:
  `cleanupRestoredCaches` in class `IgniteCacheDatabaseSharedManager`

#### cleanupCheckpointDirectory

    public void cleanupCheckpointDirectory()
                                    throws IgniteCheckedException

Clean checkpoint directory `cpDir`. The operation is necessary when local node joined to baseline topology with different consistentId.

Overrides:
  `cleanupCheckpointDirectory` in class `IgniteCacheDatabaseSharedManager`
Throws:
  `IgniteCheckedException`

#### onActivate

    public void onActivate(GridKernalContext ctx)
                    throws IgniteCheckedException

Called when cluster performing activation.

Specified by:
  `onActivate` in interface `IgniteChangeGlobalStateSupport`
Overrides:
  `onActivate` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `ctx` - Kernal context.
Throws:
  `IgniteCheckedException` - If failed.

#### onDeActivate

    public void onDeActivate(GridKernalContext kctx)

Called when cluster performing deactivation.

Specified by:
  `onDeActivate` in interface `IgniteChangeGlobalStateSupport`
Overrides:
  `onDeActivate` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `kctx` - Kernal context.

#### registerMetricsMBeans

    protected void registerMetricsMBeans(IgniteConfiguration cfg)

Registers MBeans for all DataRegionMetrics configured in this instance.

Overrides:
  `registerMetricsMBeans` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `cfg` - Ignite configuration.

#### freeSpaceProvider

    @Deprecated
    protected IgniteOutClosure<Long> freeSpaceProvider(DataRegionConfiguration dataRegCfg)

Deprecated.
Closure that can be used to compute fill factor for provided data region.

Overrides:
  `freeSpaceProvider` in class `IgniteCacheDatabaseSharedManager`
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:
  `dataRegionMetricsProvider` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `dataRegCfg` - Data region configuration.
Returns:
  DataRegionMetricsProvider.

#### onKernalStop0

    protected void onKernalStop0(boolean cancel)

Overrides:
  `onKernalStop0` in class `GridCacheSharedManagerAdapter`
Parameters:
  `cancel` - Cancel flag.

#### stop0

    protected void stop0(boolean cancel)

Overrides:
  `stop0` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `cancel` - Cancel flag.

#### createPageMemory

    protected PageMemory createPageMemory(DirectMemoryProvider memProvider,
                                          DataStorageConfiguration memCfg,
                                          DataRegionConfiguration plcCfg,
                                          DataRegionMetricsImpl memMetrics,
                                          boolean trackable)

Creates PageMemory with given size and memory provider.

Overrides:
  `createPageMemory` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `memProvider` - Memory provider.
  `memCfg` - Memory configuartion.
  `plcCfg` - data region configuration.
  `memMetrics` - DataRegionMetrics to collect memory usage metrics.
Returns:
  PageMemory instance.

#### wrapMetricsMemoryProvider

    protected DirectMemoryProvider wrapMetricsMemoryProvider(DirectMemoryProvider memoryProvider0,
                                                             DataRegionMetricsImpl memMetrics)

Overrides:
  `wrapMetricsMemoryProvider` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `memoryProvider0` - Memory provider.
  `memMetrics` - Memory metrics.
Returns:
  Wrapped memory provider.

#### checkRegionEvictionProperties

    protected void checkRegionEvictionProperties(DataRegionConfiguration regCfg,
                                                 DataStorageConfiguration dbCfg)
                                          throws IgniteCheckedException

Overrides:
  `checkRegionEvictionProperties` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `regCfg` - DataRegionConfiguration to validate.
  `dbCfg` - Memory configuration.
Throws:
  `IgniteCheckedException` - If config is invalid.

#### checkPageSize

    protected void checkPageSize(DataStorageConfiguration memCfg)

Overrides:
  `checkPageSize` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `memCfg` - Memory config.

#### beforeExchange

    public void beforeExchange(GridDhtPartitionsExchangeFuture fut)
                        throws IgniteCheckedException

Overrides:
  `beforeExchange` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `fut` - Before exchange for the given discovery event.
Throws:
  `IgniteCheckedException`

#### rebuildIndexesIfNeeded

    public void rebuildIndexesIfNeeded(GridDhtPartitionsExchangeFuture exchangeFut)

Overrides:
  `rebuildIndexesIfNeeded` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `exchangeFut` - Partition exchange future.

#### onCacheGroupsStopped

    public void onCacheGroupsStopped(Collection<IgniteBiTuple<CacheGroupContext,Boolean>> stoppedGrps)

Overrides:
  `onCacheGroupsStopped` in class `IgniteCacheDatabaseSharedManager`
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:
  `checkpointReadLock` in class `IgniteCacheDatabaseSharedManager`
Throws:
  `IgniteException` - If failed.

#### checkpointLockIsHeldByThread

    public boolean checkpointLockIsHeldByThread()

Specified by:
  `checkpointLockIsHeldByThread` in interface `CheckpointLockStateChecker`
Overrides:
  `checkpointLockIsHeldByThread` in class `IgniteCacheDatabaseSharedManager`
Returns:
  true if checkpoint lock is held by current thread

#### checkpointReadUnlock

    public void checkpointReadUnlock()

Releases the checkpoint read lock.

Overrides:
  `checkpointReadUnlock` in class `IgniteCacheDatabaseSharedManager`

#### reserveHistoryForExchange

    public Map<Integer,Map<Integer,Long>> reserveHistoryForExchange()

Reserve update history for exchange.

Overrides:
  `reserveHistoryForExchange` in class `IgniteCacheDatabaseSharedManager`
Returns:
  Reserved update counters per cache and partition.

#### releaseHistoryForExchange

    public void releaseHistoryForExchange()

Release reserved update history.

Overrides:
  `releaseHistoryForExchange` in class `IgniteCacheDatabaseSharedManager`

#### reserveHistoryForPreloading

    public boolean reserveHistoryForPreloading(Map<T2<Integer,Integer>,Long> reservationMap)

Reserve update history for preloading.

Overrides:
  `reserveHistoryForPreloading` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `reservationMap` - Map contains of counters for partitions of groups.
Returns:
  True if successfully reserved.

#### releaseHistoryForPreloading

    public void releaseHistoryForPreloading()

Release reserved update history.

Overrides:
  `releaseHistoryForPreloading` in class `IgniteCacheDatabaseSharedManager`

#### wakeupForCheckpoint

    @Nullable
    public @Nullable IgniteInternalFuture wakeupForCheckpoint(String reason)

Overrides:
  `wakeupForCheckpoint` in class `IgniteCacheDatabaseSharedManager`

#### 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:
  `waitForCheckpoint` in class `IgniteCacheDatabaseSharedManager`
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)

Allows to wait checkpoint finished.

Overrides:
  `forceCheckpoint` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `reason` - Reason.

#### lastCheckpointMarkWalPointer

    public WALPointer lastCheckpointMarkWalPointer()

Overrides:
  `lastCheckpointMarkWalPointer` in class `IgniteCacheDatabaseSharedManager`
Returns:
  Last checkpoint mark WAL pointer.

#### checkpointDirectory

    public File checkpointDirectory()

Returns:
  Checkpoint directory.

#### addCheckpointListener

    public void addCheckpointListener(DbCheckpointListener lsnr)

Parameters:
  `lsnr` - Listener.

#### removeCheckpointListener

    public void removeCheckpointListener(DbCheckpointListener lsnr)

Parameters:
  `lsnr` - Listener.

#### startMemoryRestore

    public void startMemoryRestore(GridKernalContext kctx,
                                   TimeBag startTimer)
                            throws IgniteCheckedException

Perform memory restore before `GridDiscoveryManager` start.

Overrides:
  `startMemoryRestore` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `kctx` - Current kernal context.
  `startTimer` - Holder of start time of stages.
Throws:
  `IgniteCheckedException` - If fails.

#### forAllPageStores

    public long forAllPageStores(ToLongFunction<PageStore> f)

Parameters:
  `f` - Consumer.
Returns:
  Accumulated result for all page stores.

#### 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.

#### 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:
  `onStateRestored` in class `IgniteCacheDatabaseSharedManager`
Throws:
  `IgniteCheckedException` - If first checkpoint has failed.

#### stripedApplyPage

    public void stripedApplyPage(Consumer<PageMemoryEx> consumer,
                                 int grpId,
                                 int partId,
                                 StripedExecutor exec,
                                 Semaphore semaphore)
                          throws IgniteCheckedException

Parameters:
  `consumer` - Runnable task.
  `grpId` - Group Id.
  `partId` - Partition Id.
  `exec` - Striped executor.
Throws:
  `IgniteCheckedException`

#### stripedApply

    public void stripedApply(Runnable run,
                             int grpId,
                             int partId,
                             StripedExecutor exec,
                             Semaphore semaphore)

Parameters:
  `run` - Runnable task.
  `grpId` - Group Id.
  `partId` - Partition Id.
  `exec` - Striped executor.

#### 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 IgniteCheckedException

Apply update from some iterator and with specific filters.

Parameters:
  `it` - WalIterator.
  `recPredicate` - Wal record filter.
  `entryPredicate` - Entry filter.
Throws:
  `IgniteCheckedException`

#### onWalTruncated

    public void onWalTruncated(WALPointer highBound)
                        throws IgniteCheckedException

Wal truncate callBack.

Parameters:
  `highBound` - WALPointer.
Throws:
  `IgniteCheckedException`

#### writeCheckpointEntry

    public void writeCheckpointEntry(ByteBuffer entryBuf,
                                     CheckpointEntry cp,
                                     CheckpointEntryType type)
                              throws StorageException

Writes checkpoint entry buffer `entryBuf` to specified checkpoint file with 2-phase protocol.

Parameters:
  `entryBuf` - Checkpoint entry buffer to write.
  `cp` - Checkpoint entry.
  `type` - Checkpoint entry type.
Throws:
  `StorageException` - If failed to write checkpoint entry.

#### checkpointFileName

    public static String checkpointFileName(CheckpointEntry cp,
                                            CheckpointEntryType type)

Parameters:
  `cp` - Checkpoint entry.
  `type` - Checkpoint type.
Returns:
  Checkpoint file name.

#### 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.

#### createCheckPointEntry

    public CheckpointEntry createCheckPointEntry(long cpTs,
                                                 WALPointer ptr,
                                                 UUID cpId,
                                                 @Nullable
                                                 @Nullable CheckpointRecord rec,
                                                 CheckpointEntryType type)

Parameters:
  `cpTs` - Checkpoint timestamp.
  `ptr` - Wal pointer of checkpoint.
  `cpId` - Checkpoint ID.
  `rec` - Checkpoint record.
  `type` - Checkpoint type.
Returns:
  Checkpoint entry.

#### 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 void cancelOrWaitPartitionDestroy(int grpId,
                                             int partId)
                                      throws IgniteCheckedException

Cancels or wait for partition destroy.

Parameters:
  `grpId` - Group ID.
  `partId` - Partition ID.
Throws:
  `IgniteCheckedException` - If failed.

#### checkpointReadLockTimeout

    public long checkpointReadLockTimeout()

Timeout for checkpoint read lock acquisition.

Overrides:
  `checkpointReadLockTimeout` in class `IgniteCacheDatabaseSharedManager`
Returns:
  Timeout for checkpoint read lock acquisition in milliseconds.

#### checkpointReadLockTimeout

    public void checkpointReadLockTimeout(long val)

Sets timeout for checkpoint read lock acquisition.

Overrides:
  `checkpointReadLockTimeout` in class `IgniteCacheDatabaseSharedManager`
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.

#### persistentStoreMetrics

    public DataStorageMetrics persistentStoreMetrics()

Overrides:
  `persistentStoreMetrics` in class `IgniteCacheDatabaseSharedManager`
Returns:
  DataStorageMetrics if persistence is enabled or `null` otherwise.

#### persistentStoreMetricsImpl

    public DataStorageMetricsImpl persistentStoreMetricsImpl()

#### metaStorage

    public MetaStorage metaStorage()

Overrides:
  `metaStorage` in class `IgniteCacheDatabaseSharedManager`
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 IgniteCheckedException

Notifies `MetastorageLifecycleListener` that `MetaStorage` is ready for read. This method is called when all processors and managers have already started and right before discovery manager.

Overrides:
  `notifyMetaStorageSubscribersOnReadyForRead` in class `IgniteCacheDatabaseSharedManager`
Throws:
  `IgniteCheckedException` - If failed.

#### walEnabled

    public boolean walEnabled(int grpId,
                              boolean local)

Overrides:
  `walEnabled` in class `IgniteCacheDatabaseSharedManager`
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:
  `walEnabled` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `grpId` - Group id.
  `enabled` - flag.

#### isCheckpointInapplicableForWalRebalance

    public boolean isCheckpointInapplicableForWalRebalance(Long cpTs,
                                                           int grpId)
                                                    throws IgniteCheckedException

Checks that checkpoint with timestamp `cpTs` is inapplicable as start point for WAL rebalance for given group `grpId`.

Parameters:
  `cpTs` - Checkpoint timestamp.
  `grpId` - Group ID.
Returns:
  `true` if checkpoint `cpTs` is inapplicable as start point for WAL rebalance for `grpId`.
Throws:
  `IgniteCheckedException` - If failed to check.

#### lastCheckpointInapplicableForWalRebalance

    public void lastCheckpointInapplicableForWalRebalance(int grpId)

Set last checkpoint as inapplicable for WAL rebalance for given group `grpId`.

Overrides:
  `lastCheckpointInapplicableForWalRebalance` in class `IgniteCacheDatabaseSharedManager`
Parameters:
  `grpId` - Group ID.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020