Class ReaderOptions

java.lang.Object
org.apache.opendal.ReaderOptions

public final class ReaderOptions extends Object
Selects a file version, read conditions, and execution options for an OperatorReader. All conditions must hold for data to be returned. Missing files fail with NotFound; failed conditions on existing files fail with ConditionNotMatch. Unsupported conditions fail with Unsupported. Depending on the service, errors can surface when creating the reader or while reading. Conditions apply to every request, including streams. Null version and condition fields leave those options unset.

Execution options apply independently of each logical range. Setting concurrent without setting chunk does not enable concurrent range reads. Invalid execution values fail with ConfigInvalid when the reader is created. An Instant outside the Rust core timestamp range fails with Unexpected.

  • Field Details

    • version

      public final String version
      Selects a stored file version instead of the current one. This is not a condition. Requires service support for reading versions; a missing version fails with NotFound.
    • ifMatch

      public final String ifMatch
      Reads only when the file has this exact ETag. Requires service support for if-match reads. Only concrete ETags are portable; a wildcard such as "*" has no portable meaning.
    • ifNoneMatch

      public final String ifNoneMatch
      Reads only when the file exists with a different ETag. Requires service support for if-none-match reads. Only concrete ETags are portable; "*" has no portable meaning.
    • ifVersionMatch

      public final String ifVersionMatch
      Reads only when the file has this exact version. Requires service support for version-match reads. This checks the selected file's identity rather than selecting a stored version.
    • ifVersionNotMatch

      public final String ifVersionNotMatch
      Reads only when the file exists with a different version. Requires service support for version-not-match reads.
    • ifModifiedSince

      public final Instant ifModifiedSince
      Reads only when the file was modified after this time. Requires service support for if-modified-since reads.
    • ifUnmodifiedSince

      public final Instant ifUnmodifiedSince
      Reads only when the file was not modified after this time. Requires service support for if-unmodified-since reads.
    • concurrent

      public final int concurrent
      Maximum number of internal chunk requests executed concurrently. Must be positive. This is not the number of application transfers or Java threads and only affects chunked reads.
      See Also:
    • chunk

      public final long chunk
      Target size of each internal range request, in bytes. A positive value enables chunked reads. The default of -1 keeps unchunked streaming. Zero and other negative values are invalid. The value must fit the native platform's unsigned pointer-sized integer.
      See Also:
    • prefetch

      public final int prefetch
      Maximum number of completed chunks buffered ahead of consumption, not a byte count. Must be non-negative. The default of zero applies strict backpressure. This option only affects chunked reads.
      See Also:
    • contentLengthHint

      public final long contentLengthHint
      Known full object content length in bytes, independent of the requested range. The default of -1 means unknown; zero is valid for an empty object. This hint can avoid a metadata request and is not a consistency condition. An incorrect hint can cause incomplete reads or errors. Values below -1 are invalid.
      See Also:
  • Constructor Details

    • ReaderOptions

      public ReaderOptions()