public class NosqlDbConfig extends Object
Constructor and Description |
---|
NosqlDbConfig(oracle.nosql.driver.NoSQLHandleConfig nosqlHandleConfig) |
NosqlDbConfig(String endpoint,
oracle.nosql.driver.AuthorizationProvider authorizationProvider) |
Modifier and Type | Method and Description |
---|---|
static NosqlDbConfig |
createCloudConfig(String endpoint,
String configFile)
Creates a NosqlDbConfig object based on endpoint and config file path.
|
static NosqlDbConfig |
createCloudConfig(String endpoint,
String configFile,
String profileName)
Creates a NosqlDbConfig object based on endpoint, config file path and
profile name.
|
static NosqlDbConfig |
createCloudSimConfig(String endpoint)
Creates a NosqlDbConfig object for a CloudSim server.
|
static NosqlDbConfig |
createProxyConfig(String endpoint)
Creates a NosqlDbConfig object for an on-prem server using an
httproxy server.
|
static NosqlDbConfig |
createProxyConfig(String endpoint,
String username,
char[] password)
Creates a NosqlDbConfig object for an on-prem server using a
secured httproxy server.
|
NosqlCapacityMode |
getDefaultCapacityMode()
Returns the default capacity mode set.
|
int |
getDefaultReadUnits()
Returns the value that was set for default read units or 50 otherwise.
|
int |
getDefaultStorageGB()
Returns the value that was set for default storageGB or 25 otherwise.
|
int |
getDefaultWriteUnits()
Returns the value that was set for default write units or 50 otherwise.
|
oracle.nosql.driver.NoSQLHandleConfig |
getNosqlHandleConfig() |
int |
getQueryCacheCapacity()
Returns the capacity of the prepared query cache.
|
int |
getQueryCacheLifetime()
Returns the lifetime of the prepared query cache in milliseconds.
|
int |
getTableReqPollInterval()
Returns the table request poll interval in milliseconds.
|
int |
getTableReqTimeout()
Returns the table request timeout in milliseconds.
|
int |
getTimestampPrecision()
Returns the precision of the Timestamp NoSQL DB type when creating a
new table.
|
NosqlDbConfig |
setDefaultCapacityMode(NosqlCapacityMode defaultCapacityMode)
Sets the default capacity mode when table is created if
NosqlTable annotation is not present. |
NosqlDbConfig |
setDefaultReadUnits(int defaultReadUnits)
Sets the default read units when table is created if
NosqlTable annotation is not present or it doesn't specify a
readUnits value. |
NosqlDbConfig |
setDefaultStorageGB(int defaultStorageGB)
Sets the default storageGB when table is created if
NosqlTable annotation is not present or it doesn't specify a
storageGB value. |
NosqlDbConfig |
setDefaultWriteUnits(int defaultWriteUnits)
Sets the default write units when table is created if
NosqlTable annotation is not present or it doesn't specify a
writeUnits value. |
NosqlDbConfig |
setTableReqPollInterval(int pollInterval)
Sets the table request poll interval in milliseconds.
|
NosqlDbConfig |
setTableReqTimeout(int tableReqTimeout)
Sets the table request timeout in milliseconds.
|
NosqlDbConfig |
setTimestampPrecision(int precision)
Sets the precision of the Timestamp NoSQL DB type when creating a
new table.
|
public NosqlDbConfig(String endpoint, oracle.nosql.driver.AuthorizationProvider authorizationProvider)
public NosqlDbConfig(oracle.nosql.driver.NoSQLHandleConfig nosqlHandleConfig)
public static NosqlDbConfig createCloudConfig(String endpoint, String configFile) throws IOException
endpoint
- Endpoint of service.
Example: Region.endpoint()
configFile
- Path to config file. Example: "~/.oci/config"IOException
- if config file cannot be accessed.public static NosqlDbConfig createCloudConfig(String endpoint, String configFile, String profileName) throws IOException
endpoint
- Endpoint of service.
Example: Region.endpoint()
configFile
- Path to config file. Example: "~/.oci/config"profileName
- The name of the profile defined in config file.
Example: "DEFAULT".IOException
- if config file cannot be accessed.public static NosqlDbConfig createCloudSimConfig(String endpoint)
endpoint
- Endpoint of service. Example: "http://localhost:8080"public static NosqlDbConfig createProxyConfig(String endpoint)
endpoint
- Endpoint of service. Example: "http://localhost:8080"public static NosqlDbConfig createProxyConfig(String endpoint, String username, char[] password)
endpoint
- Endpoint of service. Example: "https://localhost:8080"username
- User namepassword
- User passwordpublic oracle.nosql.driver.NoSQLHandleConfig getNosqlHandleConfig()
public int getQueryCacheCapacity()
Constants.DEFAULT_QUERY_CACHE_CAPACITY
.public int getQueryCacheLifetime()
Constants.DEFAULT_QUERY_CACHE_LIFETIME_MS
.public int getTableReqTimeout()
Constants.DEFAULT_TABLE_REQ_TIMEOUT_MS
public NosqlDbConfig setTableReqTimeout(int tableReqTimeout)
Constants.DEFAULT_TABLE_REQ_TIMEOUT_MS
public int getTableReqPollInterval()
Constants.DEFAULT_TABLE_REQ_POLL_INTEVEL_MS
public NosqlDbConfig setTableReqPollInterval(int pollInterval)
Constants.DEFAULT_TABLE_REQ_POLL_INTEVEL_MS
public int getTimestampPrecision()
Constants.DEFAULT_TIMESTAMP_PRECISION
.Timestamp values have a precision (0 - 9) which represents the fractional seconds to be held by the timestamp. A value of 0 means that no fractional seconds are stored, 3 means that the timestamp stores milliseconds, and 9 means a precision of nanoseconds.
In the context of a CREATE TABLE statement, a precision must be explicitly specified. This restriction is to prevent users from inadvertently creating TIMESTAMP values with precision 9 (which takes more space) when in reality they don't need that high precision.
See Timestamp documentation for more details.
public NosqlDbConfig setTimestampPrecision(int precision)
Constants.DEFAULT_TIMESTAMP_PRECISION
.
public NosqlDbConfig setDefaultStorageGB(int defaultStorageGB)
NosqlTable
annotation is not present or it doesn't specify a
storageGB value. Valid values are only values greater than 0. This
applies only in cloud or cloud sim scenarios.If not set the default value is 25GB.
For TableLimits
to be set one of the following two
conditions must be met:
Note: StorageBG, capacity mode and read/write units can later be configured from the OCI console or using the API.
public int getDefaultStorageGB()
public NosqlDbConfig setDefaultCapacityMode(NosqlCapacityMode defaultCapacityMode)
NosqlTable
annotation is not present. This
applies only in cloud or cloud sim scenarios.
If not set the default value is
TableLimits.CapacityMode#PROVISIONED
.
Note: StorageBG, capacity mode and read/write units can later be configured from the OCI console or using the API.
public NosqlCapacityMode getDefaultCapacityMode()
TableLimits.CapacityMode#PROVISIONED
.public NosqlDbConfig setDefaultReadUnits(int defaultReadUnits)
NosqlTable
annotation is not present or it doesn't specify a
readUnits value. Valid values are only values greater than 0. This
applies only in cloud or cloud sim scenarios.
When in PROVISIONED mode all three: storageGB, readUnits and writeUnits
must be greater than 0 to be valid.
TableLimits
.If not set the default value is 50.
Note: StorageBG, capacity mode and read/write units can later be configured from the OCI console or using the API.
public int getDefaultReadUnits()
public NosqlDbConfig setDefaultWriteUnits(int defaultWriteUnits)
NosqlTable
annotation is not present or it doesn't specify a
writeUnits value. Valid values are only values greater than 0. This
applies only in cloud or cloud sim scenarios.
When in PROVISIONED mode all three: storageGB, readUnits and writeUnits
must be greater than 0 to be valid.
TableLimits
.If not set the default value is 50.
Note: StorageBG, capacity mode and read/write units can later be configured from the OCI console or using the API.
public int getDefaultWriteUnits()
Copyright © 2022 Oracle Corporation. All rights reserved.