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

## Class IgniteCacheSnapshotManager<T extends SnapshotOperation>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter
  - - org.apache.ignite.internal.processors.cache.persistence.snapshot.IgniteCacheSnapshotManager<T>

All Implemented Interfaces:
  GridCacheSharedManager, IgniteChangeGlobalStateSupport

    public class IgniteCacheSnapshotManager<T extends SnapshotOperation>
    extends GridCacheSharedManagerAdapter
    implements IgniteChangeGlobalStateSupport

Snapshot manager stub.

### Field Summary

Fields
`static String` `SNAPSHOT_RESTORE_STARTED_LOCK_FILENAME` Snapshot started lock filename.
`static String` `TEMP_FILES_COMPLETENESS_MARKER` Temp files completeness marker.

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

`cctx, diagnosticLog, log`

### Constructor Summary

Constructors
Constructor and Description
`IgniteCacheSnapshotManager()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `afterCheckpointPageWritten()`
`void` `beforeCheckpointPageWritten()`
`void` `beforePageWrite(FullPageId fullId)`
`void` `flushDirtyPageHandler(FullPageId fullId, ByteBuffer pageBuf, Integer tag)`
`boolean` `needTxReadLogging()`
`void` `onActivate(GridKernalContext kctx)` Called when cluster performing activation.
`void` `onCacheGroupStop(CacheGroupContext gctx)`
`void` `onCacheStop(GridCacheContext cctx)`
`void` `onChangeTrackerPage(Long page, FullPageId fullId, PageMemory pageMem)`
`void` `onDeActivate(GridKernalContext kctx)` Called when cluster performing deactivation.
`IgniteFuture<?>` `onMarkCheckPointBegin(T snapshotOperation, PartitionAllocationMap map)`
`void` `onPageWrite(FullPageId fullId, ByteBuffer tmpWriteBuf, int writtenPages, int totalPages)`
`boolean` `partitionsAreFrozen(CacheGroupContext grp)`
`void` `restoreState()`
`boolean` `snapshotOperationInProgress()`
`IgniteInternalFuture` `startLocalSnapshotOperation(UUID initiatorNodeId, T snapshotOperation, AffinityTopologyVersion topVer)`
`IgniteInternalFuture` `tryStartLocalSnapshotOperation(DiscoveryEvent discoveryEvent, AffinityTopologyVersion topVer)` Try to start local snapshot operation if it's required by discovery event.

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

`context, isStopping, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStop, onKernalStop0, onReconnected, printMemoryStats, start, start0, startInfo, stop, stop0, stopInfo, toString`

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

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

### Field Detail

#### SNAPSHOT_RESTORE_STARTED_LOCK_FILENAME

    public static final String SNAPSHOT_RESTORE_STARTED_LOCK_FILENAME

Snapshot started lock filename.

See Also:
  Constant Field Values

#### TEMP_FILES_COMPLETENESS_MARKER

    public static final String TEMP_FILES_COMPLETENESS_MARKER

Temp files completeness marker.

See Also:
  Constant Field Values

### Constructor Detail

#### IgniteCacheSnapshotManager

    public IgniteCacheSnapshotManager()

### Method Detail

#### tryStartLocalSnapshotOperation

    @Nullable
    public IgniteInternalFuture tryStartLocalSnapshotOperation(@Nullable
                                                                         DiscoveryEvent discoveryEvent,
                                                                         AffinityTopologyVersion topVer)
                                                                  throws IgniteCheckedException

Try to start local snapshot operation if it's required by discovery event.

Parameters:
  `discoveryEvent` - Discovery event.
  `topVer` - topology version on the moment when this method was called
Throws:
  `IgniteCheckedException` - if failed

#### startLocalSnapshotOperation

    @Nullable
    public IgniteInternalFuture startLocalSnapshotOperation(UUID initiatorNodeId,
                                                                      T snapshotOperation,
                                                                      AffinityTopologyVersion topVer)
                                                               throws IgniteCheckedException

Parameters:
  `initiatorNodeId` - Initiator node id.
  `snapshotOperation` - Snapshot operation.
Throws:
  `IgniteCheckedException`

#### onMarkCheckPointBegin

    public IgniteFuture<?> onMarkCheckPointBegin(T snapshotOperation,
                                                 PartitionAllocationMap map)
                                          throws IgniteCheckedException

Parameters:
  `snapshotOperation` - current snapshot operation.
  `map` - (cacheId, partId) -> (lastAllocatedIndex, count)
Returns:
  `true` if next operation must be snapshot, `false` if checkpoint must be executed.
Throws:
  `IgniteCheckedException`

#### partitionsAreFrozen

    public boolean partitionsAreFrozen(CacheGroupContext grp)

#### restoreState

    public void restoreState()
                      throws IgniteCheckedException

Throws:
  `IgniteCheckedException`

#### snapshotOperationInProgress

    public boolean snapshotOperationInProgress()

#### beforeCheckpointPageWritten

    public void beforeCheckpointPageWritten()

#### afterCheckpointPageWritten

    public void afterCheckpointPageWritten()

#### beforePageWrite

    public void beforePageWrite(FullPageId fullId)

Parameters:
  `fullId` - Full id.

#### onPageWrite

    public void onPageWrite(FullPageId fullId,
                            ByteBuffer tmpWriteBuf,
                            int writtenPages,
                            int totalPages)

Parameters:
  `fullId` - Full page id.
  `tmpWriteBuf` - buffer
  `writtenPages` - Overall pages written, negative value means there is no progress tracked
  `totalPages` - Overall pages count to be written, should be positive

#### onCacheStop

    public void onCacheStop(GridCacheContext cctx)

Parameters:
  `cctx` - Cctx.

#### onCacheGroupStop

    public void onCacheGroupStop(CacheGroupContext gctx)

Parameters:
  `gctx` - Cctx.

#### onChangeTrackerPage

    public void onChangeTrackerPage(Long page,
                                    FullPageId fullId,
                                    PageMemory pageMem)
                             throws IgniteCheckedException

Throws:
  `IgniteCheckedException`

#### flushDirtyPageHandler

    public void flushDirtyPageHandler(FullPageId fullId,
                                      ByteBuffer pageBuf,
                                      Integer tag)
                               throws IgniteCheckedException

Throws:
  `IgniteCheckedException`

#### onActivate

    public void onActivate(GridKernalContext kctx)
                    throws IgniteCheckedException

Called when cluster performing activation.

Specified by:
  `onActivate` in interface `IgniteChangeGlobalStateSupport`
Parameters:
  `kctx` - Kernal context.
Throws:
  `IgniteCheckedException` - If failed.

#### onDeActivate

    public void onDeActivate(GridKernalContext kctx)

Called when cluster performing deactivation.

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

#### needTxReadLogging

    public boolean needTxReadLogging()

Returns:
  `True` if TX READ records must be logged in WAL.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.6
Release Date | : September 11 2019