public class IgniteSnapshotManager extends GridCacheSharedManagerAdapter implements IgniteSnapshot, PartitionsExchangeAware, MetastorageLifecycleListener, IgniteChangeGlobalStateSupport
These major actions available:
| Modifier and Type | Class and Description |
|---|---|
protected static class |
IgniteSnapshotManager.ClusterSnapshotFuture |
| Modifier and Type | Field and Description |
|---|---|
static String |
CP_SNAPSHOT_REASON
Text Reason for checkpoint to start snapshot operation.
|
static String |
DELTA_SUFFIX
File with delta pages suffix.
|
static String |
DFLT_SNAPSHOT_TMP_DIR
Default snapshot directory for loading remote snapshots.
|
static String |
INDEX_DELTA_NAME
File name template for index delta pages.
|
static String |
PART_DELTA_TEMPLATE
File name template consists of delta pages.
|
static String |
SNAPSHOT_METAFILE_EXT
Snapshot metafile extension.
|
static String |
SNAPSHOT_METRICS
Snapshot metrics prefix.
|
static String |
SNP_IN_PROGRESS_ERR_MSG
Snapshot in progress error message.
|
static String |
SNP_NODE_STOPPING_ERR_MSG
Error message to finalize snapshot tasks.
|
static String |
SNP_RUNNING_KEY
Metastorage key to save currently running snapshot.
|
cctx, diagnosticLog, log| Constructor and Description |
|---|
IgniteSnapshotManager(GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
Set<UUID> |
cacheStartRequiredAliveNodes(@Nullable IgniteUuid restoreId) |
IgniteFuture<Boolean> |
cancelLocalRestoreTask(String name) |
void |
cancelLocalSnapshotTask(String name) |
IgniteFuture<Void> |
cancelSnapshot(String name)
Cancel running snapshot operation.
|
IgniteFuture<Boolean> |
cancelSnapshotRestore(String name)
Cancel snapshot restore operation.
|
IgniteInternalFuture<IdleVerifyResultV2> |
checkSnapshot(String name) |
IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> |
checkSnapshot(String name,
@Nullable Collection<String> grps)
The check snapshot procedure performs compute operation over the whole cluster to verify the snapshot
entirety and partitions consistency.
|
IgniteFuture<Void> |
createSnapshot(String name)
Create a consistent copy of all persistence cache groups from the whole cluster.
|
StandaloneGridKernalContext |
createStandaloneKernalContext(String snpName,
String folderName) |
void |
deleteSnapshot(File snpDir,
String folderName) |
boolean |
isRestoring()
Check if snapshot restore process is currently running.
|
boolean |
isRestoring(String snpName)
Check if snapshot restore process is currently running.
|
boolean |
isRestoring(String cacheName,
@Nullable String grpName)
Check if the cache or group with the specified name is currently being restored from the snapshot.
|
boolean |
isSnapshotCreating() |
static boolean |
isSnapshotOperation(DiscoveryEvent evt) |
List<String> |
localSnapshotNames() |
void |
onActivate(GridKernalContext kctx)
Called when cluster performing activation.
|
void |
onCacheGroupsStopped(List<Integer> grps) |
void |
onDeActivate(GridKernalContext kctx)
Called when cluster performing deactivation.
|
void |
onDoneBeforeTopologyUnlock(GridDhtPartitionsExchangeFuture fut)
Callback from exchange process completion; called before topology is unlocked.
|
void |
onReadyForRead(ReadOnlyMetastorage metaStorage)
Is called when metastorage is made ready for read-only operations very early on node startup phase.
|
void |
onReadyForReadWrite(ReadWriteMetastorage metaStorage)
Fully functional metastore capable of performing reading and writing operations.
|
static File |
partDeltaFile(File snapshotCacheDir,
int partId) |
static String |
partDeltaFileName(int partId) |
GridCloseableIterator<CacheDataRow> |
partitionRowIterator(GridKernalContext ctx,
String grpName,
int partId,
FilePageStore pageStore) |
GridCloseableIterator<CacheDataRow> |
partitionRowIterator(GridKernalContext ctx,
String snpName,
String folderName,
String grpName,
int partId) |
SnapshotMetadata |
readSnapshotMetadata(String snpName,
String consId) |
List<SnapshotMetadata> |
readSnapshotMetadatas(String snpName) |
static File |
resolveSnapshotWorkDirectory(IgniteConfiguration cfg) |
IgniteFuture<Void> |
restoreSnapshot(String name,
@Nullable Collection<String> grpNames)
Restore cache group(s) from the snapshot.
|
IgniteFuture<Boolean> |
restoreStatus(String snpName)
Status of the restore operation cluster-wide.
|
List<File> |
snapshotCacheDirectories(String snpName,
String folderName) |
List<File> |
snapshotCacheDirectories(String snpName,
String folderName,
Predicate<String> names) |
File |
snapshotLocalDir(String snpName) |
File |
snapshotTmpDir() |
protected void |
start0() |
protected void |
stop0(boolean cancel) |
context, isStopping, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStart, onKernalStart0, onKernalStop, onKernalStop0, onReconnected, printMemoryStats, start, startInfo, stop, stopInfo, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitonDoneAfterTopologyUnlock, onInitAfterTopologyLock, onInitBeforeTopologyLockpublic static final String DELTA_SUFFIX
public static final String PART_DELTA_TEMPLATE
public static final String INDEX_DELTA_NAME
public static final String CP_SNAPSHOT_REASON
public static final String DFLT_SNAPSHOT_TMP_DIR
public static final String SNP_IN_PROGRESS_ERR_MSG
public static final String SNP_NODE_STOPPING_ERR_MSG
public static final String SNP_RUNNING_KEY
public static final String SNAPSHOT_METRICS
public static final String SNAPSHOT_METAFILE_EXT
public IgniteSnapshotManager(GridKernalContext ctx)
ctx - Kernal context.public static File partDeltaFile(File snapshotCacheDir, int partId)
snapshotCacheDir - Snapshot directory to store files.partId - Cache partition identifier.public static String partDeltaFileName(int partId)
partId - Partition id.protected void start0()
throws IgniteCheckedException
start0 in class GridCacheSharedManagerAdapterIgniteCheckedException - If failed.protected void stop0(boolean cancel)
stop0 in class GridCacheSharedManagerAdaptercancel - Cancel flag.public void onActivate(GridKernalContext kctx)
onActivate in interface IgniteChangeGlobalStateSupportkctx - Kernal context.public void onDeActivate(GridKernalContext kctx)
onDeActivate in interface IgniteChangeGlobalStateSupportkctx - Kernal context.public void deleteSnapshot(File snpDir, String folderName)
snpDir - Snapshot dir.folderName - Local node folder name (see IgniteUtils.maskForFileName(java.lang.CharSequence) with consistent id).public File snapshotLocalDir(String snpName)
snpName - Snapshot name.public File snapshotTmpDir()
public boolean isSnapshotCreating()
True if snapshot operation is in progress.public boolean isRestoring()
True if the snapshot restore operation is in progress.public boolean isRestoring(String snpName)
snpName - Snapshot name.True if the snapshot restore operation from the specified snapshot is in progress locally.public boolean isRestoring(String cacheName, @Nullable @Nullable String grpName)
cacheName - Cache name.grpName - Cache group name.True if the cache or group with the specified name is being restored.public IgniteFuture<Boolean> restoreStatus(String snpName)
snpName - Snapshot name.false if the restore process with the specified snapshot name is
not running on all nodes.public Set<UUID> cacheStartRequiredAliveNodes(@Nullable @Nullable IgniteUuid restoreId)
restoreId - Restore process ID.public List<String> localSnapshotNames()
public IgniteFuture<Void> cancelSnapshot(String name)
cancelSnapshot in interface IgniteSnapshotname - Snapshot name to cancel.public void cancelLocalSnapshotTask(String name)
name - Snapshot name to cancel operation on local node.public IgniteFuture<Boolean> cancelSnapshotRestore(String name)
cancelSnapshotRestore in interface IgniteSnapshotname - Snapshot name.false if the restore process with the specified snapshot name is not running at all.public IgniteFuture<Boolean> cancelLocalRestoreTask(String name)
name - Snapshot name.false if the restore process with the specified snapshot name is not running at all.public IgniteInternalFuture<IdleVerifyResultV2> checkSnapshot(String name)
name - Snapshot name.true if snapshot is OK.public IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> checkSnapshot(String name, @Nullable @Nullable Collection<String> grps)
IdleVerifyResult.name - Snapshot name.grps - Collection of cache group names to check.true if snapshot is OK.public List<File> snapshotCacheDirectories(String snpName, String folderName)
snpName - Snapshot name.folderName - Directory name for cache group.public List<File> snapshotCacheDirectories(String snpName, String folderName, Predicate<String> names)
snpName - Snapshot name.folderName - Directory name for cache group.names - Cache group names to filter.public SnapshotMetadata readSnapshotMetadata(String snpName, String consId)
snpName - Snapshot name.consId - Node consistent id to read medata for.public List<SnapshotMetadata> readSnapshotMetadatas(String snpName)
snpName - Snapshot name.public IgniteFuture<Void> createSnapshot(String name)
createSnapshot in interface IgniteSnapshotname - Snapshot unique name which satisfies the following name pattern [a-zA-Z0-9_].public IgniteFuture<Void> restoreSnapshot(String name, @Nullable @Nullable Collection<String> grpNames)
NOTE: Cache groups to be restored from the snapshot must not present in the cluster, if they present,
they must be destroyed by the user (eg with IgniteCache.destroy()) before starting this operation.
restoreSnapshot in interface IgniteSnapshotname - Snapshot name.grpNames - Cache groups to be restored or null to restore all cache groups from the snapshot.public void onReadyForReadWrite(ReadWriteMetastorage metaStorage) throws IgniteCheckedException
onReadyForReadWrite in interface MetastorageLifecycleListenermetaStorage - Fully functional meta storage.IgniteCheckedExceptionpublic void onReadyForRead(ReadOnlyMetastorage metaStorage) throws IgniteCheckedException
onReadyForRead in interface MetastorageLifecycleListenermetaStorage - Read-only meta storage.IgniteCheckedExceptionpublic static boolean isSnapshotOperation(DiscoveryEvent evt)
evt - Discovery event to check.true if exchange started by snapshot operation.public void onDoneBeforeTopologyUnlock(GridDhtPartitionsExchangeFuture fut)
onDoneBeforeTopologyUnlock in interface PartitionsExchangeAwarefut - Partition map exchange future.public void onCacheGroupsStopped(List<Integer> grps)
grps - List of cache groups which will be destroyed.public StandaloneGridKernalContext createStandaloneKernalContext(String snpName, String folderName) throws IgniteCheckedException
snpName - Snapshot name.folderName - The node folder name, usually it's the same as the U.maskForFileName(consistentId).IgniteCheckedException - If fails.public GridCloseableIterator<CacheDataRow> partitionRowIterator(GridKernalContext ctx, String grpName, int partId, FilePageStore pageStore) throws IgniteCheckedException
grpName - Cache group name.partId - Partition id.pageStore - File page store to iterate over.IgniteCheckedException - If and error occurs.public GridCloseableIterator<CacheDataRow> partitionRowIterator(GridKernalContext ctx, String snpName, String folderName, String grpName, int partId) throws IgniteCheckedException
snpName - Snapshot name.folderName - The node folder name, usually it's the same as the U.maskForFileName(consistentId).grpName - Cache group name.partId - Partition id.IgniteCheckedException - If and error occurs.public static File resolveSnapshotWorkDirectory(IgniteConfiguration cfg)
cfg - Ignite configuration.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.0 Release Date : September 11 2021