Package org.gridgain.internal.snapshots
Class SnapshotUtils
java.lang.Object
org.gridgain.internal.snapshots.SnapshotUtils
Utils to work with GridGain snapshots.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CompletableFuture<Void>awaitPrimaryReplicas(SnapshotManagerContext context, Collection<org.apache.ignite.internal.catalog.descriptors.CatalogTableDescriptor> tableDescriptors, org.apache.ignite.internal.catalog.Catalog catalog) Returns a future that gets completed when primary replicas for all partitions of all zones, participating in the snapshot operation, are available.static booleanisMissing(org.apache.ignite.internal.metastorage.Entry entry) Checks if the entry is missing.static voidretainTablesAndStructures(SnapshotMeta snapshotMeta, Set<org.apache.ignite.table.QualifiedName> tableNames, Set<org.apache.ignite.table.QualifiedName> structures) Retains in snapshot meta only information about specified tables and structures.static Set<org.apache.ignite.table.QualifiedName>Returns sequences used by the given tables.static List<org.apache.ignite.internal.catalog.descriptors.CatalogTableDescriptor>tempTableDescriptors(SnapshotMeta snapshotMeta, UUID operationId, org.apache.ignite.internal.catalog.Catalog catalog) Returns descriptors of the tables created during given snapshot RESTORE operation from the catalog.
-
Constructor Details
-
SnapshotUtils
public SnapshotUtils()
-
-
Method Details
-
retainTablesAndStructures
public static void retainTablesAndStructures(SnapshotMeta snapshotMeta, Set<org.apache.ignite.table.QualifiedName> tableNames, Set<org.apache.ignite.table.QualifiedName> structures) Retains in snapshot meta only information about specified tables and structures.- Parameters:
snapshotMeta- Meta to modify.tableNames- Names of the tables to retain in the meta.structures- Names of the structures (maps, sequences) to retain in the meta.
-
sequencesUsedByTables
public static Set<org.apache.ignite.table.QualifiedName> sequencesUsedByTables(Collection<TableSnapshotMeta> tables) Returns sequences used by the given tables. -
isMissing
public static boolean isMissing(org.apache.ignite.internal.metastorage.Entry entry) Checks if the entry is missing.- Parameters:
entry- Entry to check.- Returns:
trueif the entry is absent or has no value,falseotherwise.
-
tempTableDescriptors
public static List<org.apache.ignite.internal.catalog.descriptors.CatalogTableDescriptor> tempTableDescriptors(SnapshotMeta snapshotMeta, UUID operationId, org.apache.ignite.internal.catalog.Catalog catalog) Returns descriptors of the tables created during given snapshot RESTORE operation from the catalog. Until the restoration is completed, they haveSnapshotManager.tmpTableNamePrefix(UUID). -
awaitPrimaryReplicas
public static CompletableFuture<Void> awaitPrimaryReplicas(SnapshotManagerContext context, Collection<org.apache.ignite.internal.catalog.descriptors.CatalogTableDescriptor> tableDescriptors, org.apache.ignite.internal.catalog.Catalog catalog) Returns a future that gets completed when primary replicas for all partitions of all zones, participating in the snapshot operation, are available.This is needed to make sure that the initial target zones' rebalance has been completed and therefore their stable assignments exist which we can then use to compute partitions that are hosted on this node.
- See Also:
-
PartitionsCalculator
-