Record Class TransportNodesListShardStoreMetadata.StoreFilesMetadata

java.lang.Object
java.lang.Record
org.elasticsearch.indices.store.TransportNodesListShardStoreMetadata.StoreFilesMetadata
All Implemented Interfaces:
Iterable<StoreFileMetadata>, Writeable
Enclosing class:
TransportNodesListShardStoreMetadata

public static record TransportNodesListShardStoreMetadata.StoreFilesMetadata(Store.MetadataSnapshot metadataSnapshot, List<RetentionLease> peerRecoveryRetentionLeases) extends Record implements Iterable<StoreFileMetadata>, Writeable
  • Field Details

  • Constructor Details

    • StoreFilesMetadata

      public StoreFilesMetadata(Store.MetadataSnapshot metadataSnapshot, List<RetentionLease> peerRecoveryRetentionLeases)
      Creates an instance of a StoreFilesMetadata record class.
      Parameters:
      metadataSnapshot - the value for the metadataSnapshot record component
      peerRecoveryRetentionLeases - the value for the peerRecoveryRetentionLeases record component
  • Method Details

    • readFrom

      Throws:
      IOException
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • isEmpty

      public boolean isEmpty()
    • iterator

      public Iterator<StoreFileMetadata> iterator()
      Specified by:
      iterator in interface Iterable<StoreFileMetadata>
    • fileExists

      public boolean fileExists(String name)
    • file

      public StoreFileMetadata file(String name)
    • getPeerRecoveryRetentionLeaseRetainingSeqNo

      public long getPeerRecoveryRetentionLeaseRetainingSeqNo(DiscoveryNode node)
      Returns the retaining sequence number of the peer recovery retention lease for a given node if exists; otherwise, returns -1.
    • syncId

      public String syncId()
      Returns:
      commit sync id if exists, else null
    • toString

      public 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.
    • metadataSnapshot

      public Store.MetadataSnapshot metadataSnapshot()
      Returns the value of the metadataSnapshot record component.
      Returns:
      the value of the metadataSnapshot record component
    • peerRecoveryRetentionLeases

      public List<RetentionLease> peerRecoveryRetentionLeases()
      Returns the value of the peerRecoveryRetentionLeases record component.
      Returns:
      the value of the peerRecoveryRetentionLeases record component