Class OpenOptions


  • @PublicApi
    @NotThreadSafe
    public final class OpenOptions
    extends java.lang.Object
    Method options for file locations in UnderFileSystem.
    • Method Detail

      • getOffset

        public long getOffset()
        Returns:
        offset from the start of a file in bytes
      • getLength

        public long getLength()
        Returns:
        the maximum length of a file
      • getRecoverFailedOpen

        public boolean getRecoverFailedOpen()
        Returns:
        true if failed open attempts should be recovered
      • getPositionShort

        public boolean getPositionShort()
        Returns:
        true, if the operation is using positioned read to a small buffer size
      • setOffset

        public OpenOptions setOffset​(long offset)
        Sets the offset from the start of a file to be opened for reading.
        Parameters:
        offset - within a file in bytes
        Returns:
        the updated option object
      • setLength

        public OpenOptions setLength​(long length)
        Parameters:
        length - the maximum length of the file
        Returns:
        the updated option object
      • setRecoverFailedOpen

        public OpenOptions setRecoverFailedOpen​(boolean recover)
        Parameters:
        recover - true if failed open attempts should be recovered
        Returns:
        the updated option object
      • setPositionShort

        public OpenOptions setPositionShort​(boolean positionShort)
        Parameters:
        positionShort - whether the operation is positioned read to a small buffer
        Returns:
        the updated option object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

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