Record Class FileSystemSpooledSegmentHandle

java.lang.Object
java.lang.Record
io.trino.spooling.filesystem.FileSystemSpooledSegmentHandle
All Implemented Interfaces:
io.trino.spi.protocol.SpooledSegmentHandle

public record FileSystemSpooledSegmentHandle(String encoding, byte[] uuid, Optional<EncryptionKey> encryptionKey) extends Record implements io.trino.spi.protocol.SpooledSegmentHandle
  • Constructor Details

    • FileSystemSpooledSegmentHandle

      public FileSystemSpooledSegmentHandle(String encoding, byte[] uuid, Optional<EncryptionKey> encryptionKey)
      Creates an instance of a FileSystemSpooledSegmentHandle record class.
      Parameters:
      encoding - the value for the encoding record component
      uuid - the value for the uuid record component
      encryptionKey - the value for the encryptionKey record component
  • Method Details

    • random

      public static FileSystemSpooledSegmentHandle random(Random random, io.trino.spi.protocol.SpoolingContext context, Instant expireAt)
    • random

      public static FileSystemSpooledSegmentHandle random(Random random, io.trino.spi.protocol.SpoolingContext context, Instant expireAt, Optional<EncryptionKey> encryptionKey)
    • expirationTime

      public Instant expirationTime()
      Specified by:
      expirationTime in interface io.trino.spi.protocol.SpooledSegmentHandle
    • identifier

      public String identifier()
      Storage identifiers are ULIDs which are ordered lexicographically by the time of the expiration. This makes it possible to find the expired segments by listing the storage objects. This is crucial for the storage cleanup process to be able to efficiently delete the expired segments.
      Specified by:
      identifier in interface io.trino.spi.protocol.SpooledSegmentHandle
      Returns:
      String lexicographically sortable storage object name
      See Also:
    • 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.
    • encoding

      public String encoding()
      Returns the value of the encoding record component.
      Specified by:
      encoding in interface io.trino.spi.protocol.SpooledSegmentHandle
      Returns:
      the value of the encoding record component
    • uuid

      public byte[] uuid()
      Returns the value of the uuid record component.
      Returns:
      the value of the uuid record component
    • encryptionKey

      public Optional<EncryptionKey> encryptionKey()
      Returns the value of the encryptionKey record component.
      Returns:
      the value of the encryptionKey record component