Record Class FinalizeSnapshotContext.UpdatedShardGenerations

java.lang.Object
java.lang.Record
org.elasticsearch.repositories.FinalizeSnapshotContext.UpdatedShardGenerations
Enclosing class:
FinalizeSnapshotContext

public static record FinalizeSnapshotContext.UpdatedShardGenerations(ShardGenerations liveIndices, ShardGenerations deletedIndices) extends Record
A record used to track the new shard generations that have been written for each shard in a snapshot. An index may be deleted after the shard generation is written but before the snapshot is finalized. In this case, its shard generation is tracked in deletedIndices because it's still a valid shard generation blob that exists in the repository and may be used by subsequent snapshots, even though the index will not be included in the snapshot being finalized. Otherwise, it is tracked in liveIndices.
  • Field Details

  • Constructor Details

    • UpdatedShardGenerations

      public UpdatedShardGenerations(ShardGenerations liveIndices, ShardGenerations deletedIndices)
      Creates an instance of a UpdatedShardGenerations record class.
      Parameters:
      liveIndices - the value for the liveIndices record component
      deletedIndices - the value for the deletedIndices record component
  • Method Details

    • hasShardGen

      public boolean hasShardGen(RepositoryShardId repositoryShardId)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • liveIndices

      public ShardGenerations liveIndices()
      Returns the value of the liveIndices record component.
      Returns:
      the value of the liveIndices record component
    • deletedIndices

      public ShardGenerations deletedIndices()
      Returns the value of the deletedIndices record component.
      Returns:
      the value of the deletedIndices record component