Class MetaStorageKeys
java.lang.Object
org.gridgain.internal.snapshots.communication.metastorage.MetaStorageKeys
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):
- That map to Snapshot Global State in
gridgain.snapshot.create.global.<snapshot_id>format. - That map to Snapshot Local State in
gridgain.snapshot.create.local.<snapshot_id>.state.<node_name>format.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.ignite.internal.lang.ByteArraycoordinatorTermKey(UUID operationId) Creates a Meta Storage key that maps to the Snapshot Coordinator Term of a given operation.static org.apache.ignite.internal.lang.ByteArraycreateSnapshotGlobalStateKey(UUID snapshotId) Creates a Meta Storage key that maps to the Global State of a given Snapshot (Creation Flow).static org.apache.ignite.internal.lang.ByteArrayReturns a prefix of all keys that map to Global States of all snapshots (Creation Flow).static org.apache.ignite.internal.lang.ByteArraycreateSnapshotLocalStateKey(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.ByteArraycreateSnapshotLocalStatePrefix(UUID snapshotId) Returns a prefix of all keys that map to Local States of the given Snapshot (Creation Flow).static org.apache.ignite.internal.lang.ByteArraydeleteSnapshotGlobalStateKey(UUID operationId) Creates a Meta Storage key that maps to the Global State of a given delete operation.static org.apache.ignite.internal.lang.ByteArrayReturns a prefix of all keys that map to Global States of all delete operations.static org.apache.ignite.internal.lang.ByteArraydeleteSnapshotLocalStateKey(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.ByteArraydeleteSnapshotLocalStatePrefix(UUID operationId) Returns a prefix of all keys that map to Local States of the given delete operation.static org.apache.ignite.internal.lang.ByteArraydeleteSnapshotLockKey(UUID snapshotId) Meta Storage key that indicates that a particular Snapshot is being removed.static StringnodeNameFromCreateLocalStateKey(byte[] localStateKey) Extracts the node name from a given Local State Meta Storage key (Creation Flow).static StringnodeNameFromDeleteLocalStateKey(byte[] localStateKey) Extracts the node name from a given Local State Meta Storage key (Deletion Flow).static StringnodeNameFromRestoreLocalStateKey(byte[] localStateKey) Extracts the node name from a given Local State Meta Storage key (Restoration Flow).static org.apache.ignite.internal.lang.ByteArraypartitionKey(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.ByteArrayrestoreSnapshotGlobalStateKey(UUID operationId) Creates a Meta Storage key that maps to the Global State of a given restore operation.static org.apache.ignite.internal.lang.ByteArrayReturns a prefix of all keys that map to Global States of all restore operations.static org.apache.ignite.internal.lang.ByteArrayrestoreSnapshotLocalStateKey(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.ByteArrayrestoreSnapshotLocalStatePrefix(UUID operationId) Returns a prefix of all keys that map to Local States of Restore of the given Snapshot.static org.apache.ignite.internal.lang.ByteArrayMetaStorage key used to indicate that a Snapshot is being restored in a cluster.static org.apache.ignite.internal.lang.ByteArraysnapshotPartitionPrefix(UUID snapshotId) Returns prefix to partition entries used by single-copy algorithm for the given snapshot.
-
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
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
Extracts the node name from a given Local State Meta Storage key (Creation Flow).- Parameters:
localStateKey- Meta Storage key.- Returns:
- Node name.
-
nodeNameFromRestoreLocalStateKey
Extracts the node name from a given Local State Meta Storage key (Restoration Flow).- Parameters:
localStateKey- Meta Storage key.- Returns:
- Node name.
-
nodeNameFromDeleteLocalStateKey
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
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
Returns prefix to partition entries used by single-copy algorithm for the given snapshot.
-