Class ReaderOptions
OperatorReader.
All supplied conditions must hold for data to be returned. When OpenDAL issues a backend read, missing files fail with OpenDALException.Code.NotFound and failed conditions on an existing file fail with OpenDALException.Code.ConditionNotMatch. Unsupported version selection or conditions fail with OpenDALException.Code.Unsupported.
Depending on the service, errors can surface when creating the reader or while reading. Conditions apply to every request, including streams.
Execution options apply independently of each logical range. OpenDAL uses concurrent and prefetch only for chunked reads enabled by chunk. Invalid execution values fail with OpenDALException.Code.ConfigInvalid when OpenDAL creates the reader.
An Instant outside the Rust core timestamp range fails with OpenDALException.Code.Unexpected.
Optional reference fields default to null.
-
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 content length of the object.final StringRead only when the file has this exact ETag.final InstantRead only when the file was modified after this timestamp.final StringRead only when the file does not have this ETag.final InstantRead only when the file was not modified after this timestamp.final StringRead only when the file has this exact version.final StringRead only when the file does not have this version.final intControls read-ahead during concurrent range reads.final StringRead the given version of the file instead of the current one. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
version
Read the given version of the file instead of the current one.This selects which stored version the reader returns; it is not a condition on the file. A version that does not exist returns
OpenDALException.Code.NotFound.- See Also:
-
ifMatch
Read only when the file has this exact ETag.The condition succeeds when the file exists and its ETag equals this value. A file with a different ETag returns
OpenDALException.Code.ConditionNotMatch; a missing file returnsOpenDALException.Code.NotFound. Only concrete ETag values are portable; a wildcard such as"*"has no portable meaning here.- See Also:
-
ifNoneMatch
Read only when the file does not have this ETag.With a concrete ETag value, the condition succeeds when the file exists with a different ETag. A file whose ETag equals this value returns
OpenDALException.Code.ConditionNotMatch; a missing file returnsOpenDALException.Code.NotFound. Only concrete ETag values are portable; a wildcard such as"*"has no portable meaning here.- See Also:
-
ifVersionMatch
Read only when the file has this exact version.The condition succeeds when the file exists and its version equals this value. A file with a different version returns
OpenDALException.Code.ConditionNotMatch; a missing file returnsOpenDALException.Code.NotFound.This condition checks the identity of the file selected by
version.- See Also:
-
ifVersionNotMatch
Read only when the file does not have this version.The condition succeeds when the file exists with a different version. A file whose version equals this value returns
OpenDALException.Code.ConditionNotMatch; a missing file returnsOpenDALException.Code.NotFound.- See Also:
-
ifModifiedSince
Read only when the file was modified after this timestamp.The condition succeeds when the file exists and was modified after this time. A file not modified since this time returns
OpenDALException.Code.ConditionNotMatch; a missing file returnsOpenDALException.Code.NotFound.An
Instantoutside the Rust core timestamp range fails withOpenDALException.Code.Unexpected.- See Also:
-
ifUnmodifiedSince
Read only when the file was not modified after this timestamp.The condition succeeds when the file exists and was not modified after this time. A file modified after this time returns
OpenDALException.Code.ConditionNotMatch; a missing file returnsOpenDALException.Code.NotFound.An
Instantoutside the Rust core timestamp range fails withOpenDALException.Code.Unexpected.- See Also:
-
concurrent
public final int concurrentMaximum number of internal chunk requests executed concurrently.Defaults to
1. Values less than or equal to0, or too large for the native platform's unsigned pointer-sized integer, fail withOpenDALException.Code.ConfigInvalid.This setting applies only to chunked reads enabled by
chunk. Application transfer and Java thread counts are independent of this setting.- See Also:
-
chunk
public final long chunkTarget size of each internal range request in bytes.The default of
-1Lkeeps unchunked streaming. Positive values enable chunked reads and must fit the native platform's unsigned pointer-sized integer.0L, other negative values, and values that do not fit fail withOpenDALException.Code.ConfigInvalid.- See Also:
-
prefetch
public final int prefetchControls read-ahead during concurrent range reads.Up to
prefetchfinished reads can each free a slot for another range read before OpenDAL collects their results.The default,
0, disables these extra slots. Reads already submitted underconcurrentcan still finish and wait to be collected.Serial reads collect each result before starting the next read. Higher values can increase memory use.
This setting applies only to chunked reads enabled by
chunk. Negative values fail withOpenDALException.Code.ConfigInvalid.- See Also:
-
contentLengthHint
public final long contentLengthHintKnown content length of the object.Supply the full object length in bytes, regardless of the requested range. The default of
-1Lmeans the length is unknown. Use0Lfor an empty object. Values below-1Lfail withOpenDALException.Code.ConfigInvalid.OpenDAL uses this hint only to plan reads and can use it to avoid a metadata request. For chunked reads (
chunkset), acontentLengthHintno greater than the starting offset can result in no backend read requests. When the hint equals the starting offset, including0Lat the start of a file, OpenDAL may return empty data without checking file existence or evaluating conditions. An incorrect hint can truncate reads or cause errors.- See Also:
-
-
Constructor Details
-
ReaderOptions
public ReaderOptions()
-