Package oracle.kv.query
Class ExecuteOptions
- java.lang.Object
-
- oracle.kv.query.ExecuteOptions
-
public class ExecuteOptions extends Object
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
Fields Modifier and Type Field Description static short
DRIVER_QUERY_V2
static short
DRIVER_QUERY_V3
-
Constructor Summary
Constructors Constructor Description ExecuteOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Consistency
getConsistency()
Gets the last set execution consistency.Durability
getDurability()
Gets the last set execution durability.MathContext
getMathContext()
int
getMaxConcurrentRequests()
Returns the maximum number of concurrent requests.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).String
getNamespace()
Returns the namespace to use for the query, null if not set.int
getResultsBatchSize()
Returns the number of results per request.long
getTimeout()
Gets the timeout, which is an upper bound on the time interval for processing the read or write operations.TimeUnit
getTimeoutUnit()
Gets the unit of the timeout parameter, and may benull
only ifgetTimeout()
returns zero.ExecuteOptions
setConsistency(Consistency consistency)
Sets the execution consistency.ExecuteOptions
setDurability(Durability durability)
Sets the execution durability.ExecuteOptions
setMathContext(MathContext mathContext)
ExecuteOptions
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).ExecuteOptions
setNamespace(String namespace)
Sets the namespace to use for the query.ExecuteOptions
setResultsBatchSize(int resultsBatchSize)
Sets the number of results per request.ExecuteOptions
setTimeout(long timeout, TimeUnit timeoutUnit)
Thetimeout
parameter is an upper bound on the time interval for processing the operation.
-
-
-
Method Detail
-
setConsistency
public ExecuteOptions setConsistency(Consistency consistency)
Sets the execution consistency.
-
getConsistency
public Consistency getConsistency()
Gets the last set execution consistency.
-
setDurability
public ExecuteOptions setDurability(Durability durability)
Sets the execution durability.
-
getDurability
public Durability getDurability()
Gets the last set execution durability.
-
setTimeout
public ExecuteOptions setTimeout(long timeout, TimeUnit timeoutUnit)
Thetimeout
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:
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
public TimeUnit 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
public ExecuteOptions setMaxConcurrentRequests(int maxConcurrentRequests)
Sets the maximum number of concurrent requests.
-
getResultsBatchSize
public int getResultsBatchSize()
Returns the number of results per request.
-
setResultsBatchSize
public ExecuteOptions setResultsBatchSize(int resultsBatchSize)
Sets the number of results per request.
-
getMathContext
public MathContext getMathContext()
Returns theMathContext
used forBigDecimal
andBigInteger
operations.MathContext.DECIMAL32
is used by default.
-
setMathContext
public ExecuteOptions setMathContext(MathContext mathContext)
Sets theMathContext
used forBigDecimal
andBigInteger
operations.MathContext.DECIMAL32
is used by default.
-
setNamespace
public ExecuteOptions setNamespace(String namespace)
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
public String 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.
-
-