Package oracle.kv.table
Class ReadOptions
java.lang.Object
oracle.kv.table.ReadOptions
- Direct Known Subclasses:
TableIteratorOptions
ReadOptions is passed to read-only store operations to specify arguments that
control non-default behavior related to consistency and operation timeouts.
The default behavior is configured when a store is opened using
KVStoreConfig
.
- Since:
- 3.0
-
Constructor Summary
ConstructorDescriptionReadOptions
(Consistency consistency, long timeout, TimeUnit timeoutUnit) Creates aReadOptions
with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionGets the consistency used for a read operation.long
Gets the timeout, which is an upper bound on the time interval for processing the operation.Gets the unit of the timeout parameter, and may benull
only ifgetTimeout()
returns zero.
-
Constructor Details
-
ReadOptions
Creates aReadOptions
with the specified parameters.If
consistency
isnull
, thedefault consistency
is used.If
timeout
is zero thedefault request timeout
is used.The
timeout
parameter is an upper bound on the time interval for processing the operation. A best effort is made not to exceed the specified limit. If zero, thedefault request timeout
is used.If
timeout
is not 0, thetimeoutUnit
parameter must not benull
.- Parameters:
consistency
- the read consistency to use or nulltimeout
- the timeout value to usetimeoutUnit
- theTimeUnit
used by thetimeout
parameter or null- Throws:
IllegalArgumentException
- if timeout is negativeIllegalArgumentException
- if timeout is > 0 and timeoutUnit is null
-
-
Method Details
-
getConsistency
Gets the consistency used for a read operation. If null, thedefault consistency
is used.- Returns:
- the consistency used for a read operation
-
getTimeout
public long getTimeout()Gets the timeout, which is an upper bound on the time interval for processing the operation. A best effort is made not to exceed the specified limit. If zero, thedefault request timeout
is used.- Returns:
- the timeout
-
getTimeoutUnit
Gets the unit of the timeout parameter, and may benull
only ifgetTimeout()
returns zero.- Returns:
- the timeout unit or null
-