Package oracle.kv
Class KVLocalConfig
java.lang.Object
oracle.kv.KVLocalConfig
Represents the configuration parameters used to create a
KVLocal
object.
To build a KVLocalConfig object, the root directory parameter is
required. All other parameters are optional.
Use the KVLocalConfig.InetBuilder class to construct a KVLocalConfig
object using TCP sockets. For example:
// Create a configuration with root directory specified as "rootDir".
// Other parameters are set implicitly to default values.
// storeName: kvstore
// hostName: localhost
// port: 5000
// isSecure: true
// storageGB: 10
// memoryMB: 8192
KVLocalConfig config = new KVLocalConfig.InetBuilder("rootDir"))
.build();
// Create a configuration with root directory specified as "rootDir".
// Set port number to 6000 and memoryMB to 100 MB.
// Other parameters are set implicitly to default values.
// storeName: kvstore
// hostName: localhost
// isSecure: true
// storageGB: 10
KVLocalConfig config = new KVLocalConfig.InetBuilder("rootDir"))
.setPort(6000)
.setMemoryMB(100)
.build();
Use the KVLocalConfig.UnixDomainBuilder class to construct a KVLocalConfig
object using Unix domain sockets. Note that the resulting configuration can
only be used when running Java 16 or latest releases since Unix domain
sockets require at least Java 16.- Since:
- 22.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBase builder class used to set configuration parameters common to both TCP sockets and Unix domain sockets.static classInetBuilder to help construct a KVLocalConfig instance using TCP sockets.static classBuilder class to help construct aKVLocalConfiginstance using Unix domain sockets. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default memory size in megabytes is 8192, or 8 GB.static final intThe default port number is 5000.static final intThe default storage size in gigabyte is 10.static final StringThe default store name is "kvstore". -
Method Summary
Modifier and TypeMethodDescriptionReturns the host name.intReturns the memory size in MB.intgetPort()Returns the port number.Returns the directory where NoSQL Database data is placed.intReturns the storage directory size in GB.Returns the store name.booleanisSecure()Returns whether security is enabled.booleanReturns whether the configuration uses Unix domain sockets.toString()
-
Field Details
-
DEFAULT_STORENAME
The default store name is "kvstore".- See Also:
-
DEFAULT_STORAGE_SIZE_GB
public static final int DEFAULT_STORAGE_SIZE_GBThe default storage size in gigabyte is 10.- See Also:
-
DEFAULT_MEMORY_SIZE_MB
public static final int DEFAULT_MEMORY_SIZE_MBThe default memory size in megabytes is 8192, or 8 GB.- See Also:
-
DEFAULT_PORT
public static final int DEFAULT_PORTThe default port number is 5000.- See Also:
-
-
Method Details
-
toString
-
getRootDirectory
Returns the directory where NoSQL Database data is placed.- Returns:
- the directory where NoSQL Database data is placed
-
getStoreName
Returns the store name.- Returns:
- the store name
-
getHostName
Returns the host name.- Returns:
- the host name
-
getPort
public int getPort()Returns the port number.- Returns:
- the port number
-
isSecure
public boolean isSecure()Returns whether security is enabled.- Returns:
- whether security is enabled
-
getMemoryMB
public int getMemoryMB()Returns the memory size in MB.- Returns:
- the memory size in MB
-
getStorageGB
public int getStorageGB()Returns the storage directory size in GB.- Returns:
- the storage directory size in GB
-
isUnixDomain
public boolean isUnixDomain()Returns whether the configuration uses Unix domain sockets.- Returns:
- whether the configuration uses Unix domain sockets
-