java.lang.Object
org.gridgain.internal.snapshots.communication.metastorage.MetaStorageKeys

public class MetaStorageKeys extends Object
Class containing methods and constants related to Meta Storage keys used in the Snapshot Protocol.

There exist 2 types of keys for every type of operations (creation, restoration and removal):

  1. That map to Snapshot Global State in gridgain.snapshot.create.global.<snapshot_id> format.
  2. That map to Snapshot Local State in gridgain.snapshot.create.local.<snapshot_id>.state.<node_name> format.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.ignite.internal.lang.ByteArray
    coordinatorTermKey(UUID operationId)
    Creates a Meta Storage key that maps to the Snapshot Coordinator Term of a given operation.
    static org.apache.ignite.internal.lang.ByteArray
    Creates a Meta Storage key that maps to the Global State of a given Snapshot (Creation Flow).
    static org.apache.ignite.internal.lang.ByteArray
    Returns a prefix of all keys that map to Global States of all snapshots (Creation Flow).
    static org.apache.ignite.internal.lang.ByteArray
    createSnapshotLocalStateKey(UUID snapshotId, String nodeName)
    Creates a Meta Storage key that maps to the Local State of a particular node for a given Snapshot ID (Creation Flow).
    static org.apache.ignite.internal.lang.ByteArray
    Returns a prefix of all keys that map to Local States of the given Snapshot (Creation Flow).
    static org.apache.ignite.internal.lang.ByteArray
    Creates a Meta Storage key that maps to the Global State of a given delete operation.
    static org.apache.ignite.internal.lang.ByteArray
    Returns a prefix of all keys that map to Global States of all delete operations.
    static org.apache.ignite.internal.lang.ByteArray
    deleteSnapshotLocalStateKey(UUID operationId, String nodeName)
    Creates a Meta Storage key that maps to the Local State of a particular node for a given delete operation ID.
    static org.apache.ignite.internal.lang.ByteArray
    Returns a prefix of all keys that map to Local States of the given delete operation.
    static org.apache.ignite.internal.lang.ByteArray
    Meta Storage key that indicates that a particular Snapshot is being removed.
    static String
    nodeNameFromCreateLocalStateKey(byte[] localStateKey)
    Extracts the node name from a given Local State Meta Storage key (Creation Flow).
    static String
    nodeNameFromDeleteLocalStateKey(byte[] localStateKey)
    Extracts the node name from a given Local State Meta Storage key (Deletion Flow).
    static String
    nodeNameFromRestoreLocalStateKey(byte[] localStateKey)
    Extracts the node name from a given Local State Meta Storage key (Restoration Flow).
    static org.apache.ignite.internal.lang.ByteArray
    partitionKey(UUID snapshotId, org.apache.ignite.internal.replicator.TablePartitionId partition)
    Returns a key to the table partition entry used by single-copy algorithm.
    static org.apache.ignite.internal.lang.ByteArray
    Creates a Meta Storage key that maps to the Global State of a given restore operation.
    static org.apache.ignite.internal.lang.ByteArray
    Returns a prefix of all keys that map to Global States of all restore operations.
    static org.apache.ignite.internal.lang.ByteArray
    restoreSnapshotLocalStateKey(UUID operationId, String nodeName)
    Creates a Meta Storage key that maps to the Local State of a particular node for a given restore operation ID.
    static org.apache.ignite.internal.lang.ByteArray
    Returns a prefix of all keys that map to Local States of Restore of the given Snapshot.
    static org.apache.ignite.internal.lang.ByteArray
    MetaStorage key used to indicate that a Snapshot is being restored in a cluster.
    static org.apache.ignite.internal.lang.ByteArray
    Returns prefix to partition entries used by single-copy algorithm for the given snapshot.

    Methods inherited from class java.lang.Object

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

    • MetaStorageKeys

      public MetaStorageKeys()
  • Method Details

    • createSnapshotGlobalStatePrefix

      public static org.apache.ignite.internal.lang.ByteArray createSnapshotGlobalStatePrefix()
      Returns a prefix of all keys that map to Global States of all snapshots (Creation Flow).
      Returns:
      Meta Storage key prefix that maps to Global States.
    • restoreSnapshotGlobalStatePrefix

      public static org.apache.ignite.internal.lang.ByteArray restoreSnapshotGlobalStatePrefix()
      Returns a prefix of all keys that map to Global States of all restore operations.
      Returns:
      Meta Storage key prefix that maps to Global States.
    • deleteSnapshotGlobalStatePrefix

      public static org.apache.ignite.internal.lang.ByteArray deleteSnapshotGlobalStatePrefix()
      Returns a prefix of all keys that map to Global States of all delete operations.
      Returns:
      Meta Storage key prefix that maps to Global States.
    • createSnapshotGlobalStateKey

      public static org.apache.ignite.internal.lang.ByteArray createSnapshotGlobalStateKey(UUID snapshotId)
      Creates a Meta Storage key that maps to the Global State of a given Snapshot (Creation Flow).
      Parameters:
      snapshotId - Snapshot ID.
      Returns:
      Meta Storage key that maps to the Global State.
    • restoreSnapshotGlobalStateKey

      public static org.apache.ignite.internal.lang.ByteArray restoreSnapshotGlobalStateKey(UUID operationId)
      Creates a Meta Storage key that maps to the Global State of a given restore operation.
      Parameters:
      operationId - Operation ID.
      Returns:
      Meta Storage key that maps to the Global State.
    • deleteSnapshotGlobalStateKey

      public static org.apache.ignite.internal.lang.ByteArray deleteSnapshotGlobalStateKey(UUID operationId)
      Creates a Meta Storage key that maps to the Global State of a given delete operation.
      Parameters:
      operationId - Operation ID.
      Returns:
      Meta Storage key that maps to the Global State.
    • coordinatorTermKey

      public static org.apache.ignite.internal.lang.ByteArray coordinatorTermKey(UUID operationId)
      Creates a Meta Storage key that maps to the Snapshot Coordinator Term of a given operation.
      Parameters:
      operationId - Operation ID.
      Returns:
      Meta Storage key that maps to the Snapshot Coordinator Term.
    • createSnapshotLocalStatePrefix

      public static org.apache.ignite.internal.lang.ByteArray createSnapshotLocalStatePrefix(UUID snapshotId)
      Returns a prefix of all keys that map to Local States of the given Snapshot (Creation Flow).
      Parameters:
      snapshotId - Snapshot ID.
      Returns:
      Meta Storage key prefix that maps to Local States.
    • restoreSnapshotLocalStatePrefix

      public static org.apache.ignite.internal.lang.ByteArray restoreSnapshotLocalStatePrefix(UUID operationId)
      Returns a prefix of all keys that map to Local States of Restore of the given Snapshot.
      Parameters:
      operationId - Operation ID.
      Returns:
      Meta Storage key prefix that maps to Local States.
    • deleteSnapshotLocalStatePrefix

      public static org.apache.ignite.internal.lang.ByteArray deleteSnapshotLocalStatePrefix(UUID operationId)
      Returns a prefix of all keys that map to Local States of the given delete operation.
      Parameters:
      operationId - Operation ID.
      Returns:
      Meta Storage key prefix that maps to Local States.
    • createSnapshotLocalStateKey

      public static org.apache.ignite.internal.lang.ByteArray createSnapshotLocalStateKey(UUID snapshotId, String nodeName)
      Creates a Meta Storage key that maps to the Local State of a particular node for a given Snapshot ID (Creation Flow).
      Parameters:
      snapshotId - Snapshot ID.
      nodeName - Node name.
      Returns:
      Meta Storage key that maps to the Local State.
    • restoreSnapshotLocalStateKey

      public static org.apache.ignite.internal.lang.ByteArray restoreSnapshotLocalStateKey(UUID operationId, String nodeName)
      Creates a Meta Storage key that maps to the Local State of a particular node for a given restore operation ID.
      Parameters:
      operationId - Operation ID.
      nodeName - Node name.
      Returns:
      Meta Storage key that maps to the Local State.
    • deleteSnapshotLocalStateKey

      public static org.apache.ignite.internal.lang.ByteArray deleteSnapshotLocalStateKey(UUID operationId, String nodeName)
      Creates a Meta Storage key that maps to the Local State of a particular node for a given delete operation ID.
      Parameters:
      operationId - Operation ID.
      nodeName - Node name.
      Returns:
      Meta Storage key that maps to the Local State.
    • nodeNameFromCreateLocalStateKey

      public static String nodeNameFromCreateLocalStateKey(byte[] localStateKey)
      Extracts the node name from a given Local State Meta Storage key (Creation Flow).
      Parameters:
      localStateKey - Meta Storage key.
      Returns:
      Node name.
    • nodeNameFromRestoreLocalStateKey

      public static String nodeNameFromRestoreLocalStateKey(byte[] localStateKey)
      Extracts the node name from a given Local State Meta Storage key (Restoration Flow).
      Parameters:
      localStateKey - Meta Storage key.
      Returns:
      Node name.
    • nodeNameFromDeleteLocalStateKey

      public static String nodeNameFromDeleteLocalStateKey(byte[] localStateKey)
      Extracts the node name from a given Local State Meta Storage key (Deletion Flow).
      Parameters:
      localStateKey - Meta Storage key.
      Returns:
      Node name.
    • restoreSnapshotLockKey

      public static org.apache.ignite.internal.lang.ByteArray restoreSnapshotLockKey()
      MetaStorage key used to indicate that a Snapshot is being restored in a cluster. It is needed to prevent multiple Snapshot restorations to run at the same time.
    • deleteSnapshotLockKey

      public static org.apache.ignite.internal.lang.ByteArray deleteSnapshotLockKey(UUID snapshotId)
      Meta Storage key that indicates that a particular Snapshot is being removed.
    • partitionKey

      public static org.apache.ignite.internal.lang.ByteArray partitionKey(UUID snapshotId, org.apache.ignite.internal.replicator.TablePartitionId partition)
      Returns a key to the table partition entry used by single-copy algorithm.
    • snapshotPartitionPrefix

      public static org.apache.ignite.internal.lang.ByteArray snapshotPartitionPrefix(UUID snapshotId)
      Returns prefix to partition entries used by single-copy algorithm for the given snapshot.