Package oracle.kv

Class KVLocalConfig

java.lang.Object
oracle.kv.KVLocalConfig

public class KVLocalConfig extends Object
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
  • Field Details

    • DEFAULT_STORENAME

      public static final String DEFAULT_STORENAME
      The default store name is "kvstore".
      See Also:
    • DEFAULT_STORAGE_SIZE_GB

      public static final int DEFAULT_STORAGE_SIZE_GB
      The default storage size in gigabyte is 10.
      See Also:
    • DEFAULT_MEMORY_SIZE_MB

      public static final int DEFAULT_MEMORY_SIZE_MB
      The default memory size in megabytes is 8192, or 8 GB.
      See Also:
    • DEFAULT_PORT

      public static final int DEFAULT_PORT
      The default port number is 5000.
      See Also:
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getRootDirectory

      public String getRootDirectory()
      Returns the directory where NoSQL Database data is placed.
      Returns:
      the directory where NoSQL Database data is placed
    • getStoreName

      public String getStoreName()
      Returns the store name.
      Returns:
      the store name
    • getHostName

      public String 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