Package oracle.kv.query
Class ExecuteOptions
java.lang.Object
oracle.kv.query.ExecuteOptions
Class contains several options for the execution of an SQL statement
(DDL or DML). SQL statements are executed via one of the
KVStore.execute() methods.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the last set execution consistency.Gets the last set execution durability.int
Returns the maximum number of concurrent requests.long
Get the maximum number of memory bytes that may be consumed by the statement at the client for blocking operations, such as duplicate elimination (which may be required due to the use of an index on an array or map) and sorting (sorting by distance when a query contains a geo_near() function).Returns the namespace to use for the query, null if not set.int
Returns the number of results per request (seesetResultsBatchSize(int)
).long
Gets the timeout, which is an upper bound on the time interval for processing the read or write operations.Gets the unit of the timeout parameter, and may benull
only ifgetTimeout()
returns zero.setConsistency
(Consistency consistency) Sets the execution consistency.setDurability
(Durability durability) Sets the execution durability.setMathContext
(MathContext mathContext) setMaxConcurrentRequests
(int maxConcurrentRequests) Sets the maximum number of concurrent requests.void
setMaxMemoryConsumption
(long v) Set the maximum number of memory bytes that may be consumed by the statement at the client for blocking operations, such as duplicate elimination (which may be required due to the use of an index on an array or map) and sorting (sorting by distance when a query contains a geo_near() function).setNamespace
(String namespace) Sets the namespace to use for the query.setResultsBatchSize
(int resultsBatchSize) Sets the max number of query results to be generated during the execution of the query over a partition or shard (which takes place at a replication node (RN) that contains the target partition/shard).setTimeout
(long timeout, TimeUnit timeoutUnit) Thetimeout
parameter is an upper bound on the time interval for processing one of the KVStore.execute(...) methods (KVStore.execute(String, ExecuteOptions)
,KVStore.executeSync(String, ExecuteOptions)
, orKVStore.executeSync(Statement, ExecuteOptions)
) and any of the subsequent next() and hasNext() invocations ofStatementResult.iterator()
.
-
Field Details
-
DRIVER_QUERY_V2
public static short DRIVER_QUERY_V2 -
DRIVER_QUERY_V3
public static short DRIVER_QUERY_V3
-
-
Constructor Details
-
ExecuteOptions
public ExecuteOptions()
-
-
Method Details
-
setConsistency
Sets the execution consistency. -
getConsistency
Gets the last set execution consistency. -
setDurability
Sets the execution durability. -
getDurability
Gets the last set execution durability. -
setTimeout
Thetimeout
parameter is an upper bound on the time interval for processing one of the KVStore.execute(...) methods (KVStore.execute(String, ExecuteOptions)
,KVStore.executeSync(String, ExecuteOptions)
, orKVStore.executeSync(Statement, ExecuteOptions)
) and any of the subsequent next() and hasNext() invocations ofStatementResult.iterator()
. Also, in case of asynchronous query execution (viaKVStore.executeAsync(String, ExecuteOptions)
orKVStore.executeAsync(Statement, ExecuteOptions)
) is an upper bound on the time interval between two successive callbacks to the Subscriber instance used for the query execution. 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:
timeout
- the timeout value to usetimeoutUnit
- theTimeUnit
used by thetimeout
parameter or null
-
getTimeout
public long getTimeout()Gets the timeout, which is an upper bound on the time interval for processing the read or write operations. 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
-
getMaxConcurrentRequests
public int getMaxConcurrentRequests()Returns the maximum number of concurrent requests. -
setMaxConcurrentRequests
Sets the maximum number of concurrent requests. -
getResultsBatchSize
public int getResultsBatchSize()Returns the number of results per request (seesetResultsBatchSize(int)
). -
setResultsBatchSize
Sets the max number of query results to be generated during the execution of the query over a partition or shard (which takes place at a replication node (RN) that contains the target partition/shard). If this max is reached, query execution at the RN stops and the generated batch of results is returned to the driver. If more results may be available at the same partition/shard, the driver will later send the query back to an RN that contains the target partition/shard and request another batch of results. The query will resume execution at the point where it got suspended during the previous batch. -
getMathContext
Returns theMathContext
used forBigDecimal
andBigInteger
operations.MathContext.DECIMAL32
is used by default. -
setMathContext
Sets theMathContext
used forBigDecimal
andBigInteger
operations.MathContext.DECIMAL32
is used by default. -
setNamespace
Sets the namespace to use for the query. Query specified namespace takes precedence, else this namespace value is used for unqualified table names.- Since:
- 18.3
-
getNamespace
Returns the namespace to use for the query, null if not set.- Since:
- 18.3
-
setMaxMemoryConsumption
public void setMaxMemoryConsumption(long v) Set the maximum number of memory bytes that may be consumed by the statement at the client for blocking operations, such as duplicate elimination (which may be required due to the use of an index on an array or map) and sorting (sorting by distance when a query contains a geo_near() function). Such operations may consume a lot of memory as they need to cache the full result set at the client memory. The default value is 100MB.- Since:
- 18.3
-
getMaxMemoryConsumption
public long getMaxMemoryConsumption()Get the maximum number of memory bytes that may be consumed by the statement at the client for blocking operations, such as duplicate elimination (which may be required due to the use of an index on an array or map) and sorting (sorting by distance when a query contains a geo_near() function). Such operations may consume a lot of memory as they need to cache the full result set at the client memory. The default value is 100MB.
-