Package oracle.kv
Class KVLocalConfig.Builder
- java.lang.Object
-
- oracle.kv.KVLocalConfig.Builder
-
- Direct Known Subclasses:
KVLocalConfig.InetBuilder,KVLocalConfig.UnixDomainBuilder
- Enclosing class:
- KVLocalConfig
public abstract static class KVLocalConfig.Builder extends java.lang.ObjectBase builder class used to set configuration parameters common to both TCP sockets and Unix domain sockets.
-
-
Constructor Summary
Constructors Constructor Description Builder(java.lang.String rootDir)Makes a builder for KVLocalConfig with the specified root directory.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract KVLocalConfigbuild()Builds aKVLocalConfiginstance using the values specified in this builder.abstract KVLocalConfig.BuilderisSecure(boolean secure)Specifies whether the store is secure.abstract KVLocalConfig.BuildersetHostName(java.lang.String name)Sets the host name.KVLocalConfig.BuildersetMemoryMB(int mb)Sets the memory size in megabytes.abstract KVLocalConfig.BuildersetPort(int portNum)Sets port number.KVLocalConfig.BuildersetStorageGB(int gb)Sets the storage directory size in gigabytes.KVLocalConfig.BuildersetStoreName(java.lang.String name)Sets store name.
-
-
-
Method Detail
-
setStoreName
public KVLocalConfig.Builder setStoreName(java.lang.String name)
Sets store name.- Parameters:
name- the name of the store- Returns:
- this instance
- Throws:
java.lang.IllegalArgumentException- if store name is null or empty
-
setHostName
public abstract KVLocalConfig.Builder setHostName(java.lang.String name)
Sets the host name.- Parameters:
name- the name of the host- Returns:
- this instance
- Throws:
java.lang.IllegalArgumentException- if host name is null or emptyjava.lang.UnsupportedOperationException- if this builder does not support setting the host name
-
setMemoryMB
public KVLocalConfig.Builder setMemoryMB(int mb)
Sets the memory size in megabytes. Specifies the size of the Java heap used to run the embedded store.- Parameters:
mb- the memory size in megabytes- Returns:
- this instance
- Throws:
java.lang.IllegalArgumentException- if the memory size is less than 1
-
setStorageGB
public KVLocalConfig.Builder setStorageGB(int gb)
Sets the storage directory size in gigabytes.The storage directory size is the disk space limit for the Storage Node. If a Storage Node exceeds its disk usage threshold value (storage directory size - 5 GB), then the store suspends all write activities on that node, until sufficient data is removed to satisfy the threshold requirement. If the storage directory size is set to 0, the store opportunistically uses all available space, less 5 GB free disk space.
- Parameters:
gb- the storage directory size in gigabytes- Returns:
- this instance
- Throws:
java.lang.IllegalArgumentException- if the storage directory size is negative
-
build
public abstract KVLocalConfig build()
Builds aKVLocalConfiginstance using the values specified in this builder.- Returns:
- a
KVLocalConfiginstance for this builder
-
setPort
public abstract KVLocalConfig.Builder setPort(int portNum)
Sets port number.- Parameters:
portNum- the port number for registry- Returns:
- this instance
- Throws:
java.lang.IllegalArgumentException- if the port number is not in the range 0 to 65535java.lang.UnsupportedOperationException- if this builder does not support setting the port number
-
isSecure
public abstract KVLocalConfig.Builder isSecure(boolean secure)
Specifies whether the store is secure.- Parameters:
secure- whether the store is secure- Returns:
- this instance
- Throws:
java.lang.UnsupportedOperationException- if this builder does not support enabling or disabling security
-
-