Class SnapshotUtils

java.lang.Object
org.gridgain.internal.snapshots.SnapshotUtils

public class SnapshotUtils extends Object
Utils to work with GridGain snapshots.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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 void
    filterTables(SnapshotMeta snapshotMeta, Set<org.apache.ignite.table.QualifiedName> tableNames)
    Retains in snapshot meta only information about specified tables.
    static boolean
    isMissing(org.apache.ignite.internal.metastorage.Entry entry)
    Checks if the entry is missing.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SnapshotUtils

      public SnapshotUtils()
  • Method Details

    • filterTables

      public static void filterTables(SnapshotMeta snapshotMeta, Set<org.apache.ignite.table.QualifiedName> tableNames)
      Retains in snapshot meta only information about specified tables.
      Parameters:
      snapshotMeta - Meta to modify.
      tableNames - Names of the tables to retain in the meta.
    • isMissing

      public static boolean isMissing(org.apache.ignite.internal.metastorage.Entry entry)
      Checks if the entry is missing.
      Parameters:
      entry - Entry to check.
      Returns:
      true if the entry is absent or has no value, false otherwise.
    • 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 have SnapshotManager.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