Class ReaderOptions
java.lang.Object
org.apache.opendal.ReaderOptions
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 Summary
FieldsModifier and TypeFieldDescriptionfinal longTarget size of each internal range request, in bytes.final intMaximum number of internal chunk requests executed concurrently.final longKnown full object content length in bytes, independent of the requested range.final StringReads only when the file has this exact ETag.final InstantReads only when the file was modified after this time.final StringReads only when the file exists with a different ETag.final InstantReads only when the file was not modified after this time.final StringReads only when the file has this exact version.final StringReads only when the file exists with a different version.final intMaximum number of completed chunks buffered ahead of consumption, not a byte count.final StringSelects a stored file version instead of the current one. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
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
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
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
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
Reads only when the file exists with a different version. Requires service support for version-not-match reads. -
ifModifiedSince
Reads only when the file was modified after this time. Requires service support for if-modified-since reads. -
ifUnmodifiedSince
Reads only when the file was not modified after this time. Requires service support for if-unmodified-since reads. -
concurrent
public final int concurrentMaximum 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 chunkTarget 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 prefetchMaximum 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 contentLengthHintKnown 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()
-