Class NosqlDbConfig
-
Constructor Summary
ConstructorsConstructorDescriptionNosqlDbConfig
(String endpoint, oracle.nosql.driver.AuthorizationProvider authorizationProvider) NosqlDbConfig
(oracle.nosql.driver.NoSQLHandleConfig nosqlHandleConfig) -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.Returns the default capacity mode set.int
Returns the value that was set for default read units or 50 otherwise.int
Returns the value that was set for default storageGB or 25 otherwise.int
Returns the value that was set for default write units or 50 otherwise.oracle.nosql.driver.NoSQLHandleConfig
int
Returns the capacity of the prepared query cache.int
Returns the lifetime of the prepared query cache in milliseconds.int
Returns the table request poll interval in milliseconds.int
Returns the table request timeout in milliseconds.int
Returns the precision of the Timestamp NoSQL DB type when creating a new table.setDefaultCapacityMode
(NosqlCapacityMode defaultCapacityMode) Sets the default capacity mode when table is created ifNosqlTable
annotation is not present.setDefaultReadUnits
(int defaultReadUnits) Sets the default read units when table is created ifNosqlTable
annotation is not present or it doesn't specify a readUnits value.setDefaultStorageGB
(int defaultStorageGB) Sets the default storageGB when table is created ifNosqlTable
annotation is not present or it doesn't specify a storageGB value.setDefaultWriteUnits
(int defaultWriteUnits) Sets the default write units when table is created ifNosqlTable
annotation is not present or it doesn't specify a writeUnits value.setTableReqPollInterval
(int pollInterval) Sets the table request poll interval in milliseconds.setTableReqTimeout
(int tableReqTimeout) Sets the table request timeout in milliseconds.setTimestampPrecision
(int precision) Sets the precision of the Timestamp NoSQL DB type when creating a new table.
-
Constructor Details
-
NosqlDbConfig
public NosqlDbConfig(String endpoint, oracle.nosql.driver.AuthorizationProvider authorizationProvider) -
NosqlDbConfig
public NosqlDbConfig(oracle.nosql.driver.NoSQLHandleConfig nosqlHandleConfig)
-
-
Method Details
-
createCloudConfig
public static NosqlDbConfig createCloudConfig(String endpoint, String configFile) throws IOException Creates a NosqlDbConfig object based on endpoint and config file path. Note: Will use the DEFAULT profile from config file. Note: For use with NoSQL DB Cloud Service only.- Parameters:
endpoint
- Endpoint of service. Example:Region.endpoint()
configFile
- Path to config file. Example: "~/.oci/config"- Returns:
- returns the NosqlDbConfig object.
- Throws:
IOException
- if config file cannot be accessed.
-
createCloudConfig
public static NosqlDbConfig createCloudConfig(String endpoint, String configFile, String profileName) throws IOException Creates a NosqlDbConfig object based on endpoint, config file path and profile name. Note: For use with NoSQL DB Cloud Service only.- Parameters:
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".- Returns:
- returns the NosqlDbConfig object.
- Throws:
IOException
- if config file cannot be accessed.
-
createCloudSimConfig
Creates a NosqlDbConfig object for a CloudSim server.- Parameters:
endpoint
- Endpoint of service. Example: "http://localhost:8080"- Returns:
- returns the NosqlDbConfig object.
-
createProxyConfig
Creates a NosqlDbConfig object for an on-prem server using an httproxy server.- Parameters:
endpoint
- Endpoint of service. Example: "http://localhost:8080"- Returns:
- returns the NosqlDbConfig object.
-
createProxyConfig
Creates a NosqlDbConfig object for an on-prem server using a secured httproxy server.- Parameters:
endpoint
- Endpoint of service. Example: "https://localhost:8080"username
- User namepassword
- User password- Returns:
- returns the NosqlDbConfig object.
-
getNosqlHandleConfig
public oracle.nosql.driver.NoSQLHandleConfig getNosqlHandleConfig() -
getQueryCacheCapacity
public int getQueryCacheCapacity()Returns the capacity of the prepared query cache. By default this is set toConstants.DEFAULT_QUERY_CACHE_CAPACITY
. -
getQueryCacheLifetime
public int getQueryCacheLifetime()Returns the lifetime of the prepared query cache in milliseconds. By default this is set toConstants.DEFAULT_QUERY_CACHE_LIFETIME_MS
. -
getTableReqTimeout
public int getTableReqTimeout()Returns the table request timeout in milliseconds. By default this is set toConstants.DEFAULT_TABLE_REQ_TIMEOUT_MS
-
setTableReqTimeout
Sets the table request timeout in milliseconds. By default this is set toConstants.DEFAULT_TABLE_REQ_TIMEOUT_MS
-
getTableReqPollInterval
public int getTableReqPollInterval()Returns the table request poll interval in milliseconds. By default this is set toConstants.DEFAULT_TABLE_RED_POLL_INTERVAL_MS
-
setTableReqPollInterval
Sets the table request poll interval in milliseconds. By default this is set toConstants.DEFAULT_TABLE_RED_POLL_INTERVAL_MS
-
getTimestampPrecision
public int getTimestampPrecision()Returns the precision of the Timestamp NoSQL DB type when creating a new table. By default this is set toConstants.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.
-
setTimestampPrecision
Sets the precision of the Timestamp NoSQL DB type when creating a new table. By default this is set toConstants.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. -
setDefaultStorageGB
Sets the default storageGB when table is created ifNosqlTable
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:- capacityMode is set to PROVISIONED and all three: readUnits, writeUnits and storageGB must be greater than 0,
- or capacityMode is set to ON_DEMAND and storageGB must be greater than 0.
Note: StorageBG, capacity mode and read/write units can later be configured from the OCI console or using the API.
-
getDefaultStorageGB
public int getDefaultStorageGB()Returns the value that was set for default storageGB or 25 otherwise. -
setDefaultCapacityMode
Sets the default capacity mode when table is created ifNosqlTable
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.
-
getDefaultCapacityMode
Returns the default capacity mode set. If not set the returned value isTableLimits.CapacityMode.PROVISIONED
. -
setDefaultReadUnits
Sets the default read units when table is created ifNosqlTable
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.
-
getDefaultReadUnits
public int getDefaultReadUnits()Returns the value that was set for default read units or 50 otherwise. -
setDefaultWriteUnits
Sets the default write units when table is created ifNosqlTable
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.
-
getDefaultWriteUnits
public int getDefaultWriteUnits()Returns the value that was set for default write units or 50 otherwise.
-