Class IndexMetaDataGenerations

java.lang.Object
org.elasticsearch.repositories.IndexMetaDataGenerations

public final class IndexMetaDataGenerations
extends java.lang.Object
  • Field Details

  • Method Details

    • isEmpty

      public boolean isEmpty()
    • getIndexMetaBlobId

      @Nullable public java.lang.String getIndexMetaBlobId​(java.lang.String metaIdentifier)
      Gets the blob id by the identifier of IndexMetadata (computed via buildUniqueIdentifier(org.elasticsearch.cluster.metadata.IndexMetadata)) or null if none is tracked for the identifier.
      Parameters:
      metaIdentifier - identifier for IndexMetadata
      Returns:
      blob id for the given metadata identifier or null if the identifier is not part of the repository yet
    • indexMetaBlobId

      public java.lang.String indexMetaBlobId​(SnapshotId snapshotId, IndexId indexId)
      Get the blob id by SnapshotId and IndexId and fall back to the value of SnapshotId.getUUID() if none is known to enable backwards compatibility with versions older than SnapshotsService.SHARD_GEN_IN_REPO_DATA_VERSION which used the snapshot uuid as index metadata blob uuid.
      Parameters:
      snapshotId - Snapshot Id
      indexId - Index Id
      Returns:
      blob id for the given index metadata
    • withAddedSnapshot

      public IndexMetaDataGenerations withAddedSnapshot​(SnapshotId snapshotId, java.util.Map<IndexId,​java.lang.String> newLookup, java.util.Map<java.lang.String,​java.lang.String> newIdentifiers)
      Create a new instance with the given snapshot and index metadata uuids and identifiers added.
      Parameters:
      snapshotId - SnapshotId
      newLookup - new mappings of index + snapshot to index metadata identifier
      newIdentifiers - new mappings of index metadata identifier to blob id
      Returns:
      instance with added snapshot
    • withRemovedSnapshots

      public IndexMetaDataGenerations withRemovedSnapshots​(java.util.Collection<SnapshotId> snapshotIds)
      Create a new instance with the given snapshot removed.
      Parameters:
      snapshotIds - SnapshotIds to remove
      Returns:
      new instance without the given snapshot
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object that)
      Overrides:
      equals in class java.lang.Object
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • buildUniqueIdentifier

      public static java.lang.String buildUniqueIdentifier​(IndexMetadata indexMetaData)
      Compute identifier for IndexMetadata from its index- and history-uuid as well as its settings-, mapping- and alias-version. If an index did not see a change in its settings, mappings or aliases between two points in time then the identifier will not change between them either.
      Parameters:
      indexMetaData - IndexMetaData
      Returns:
      identifier string