Package oracle.kv

Class KVLocalConfig


  • public class KVLocalConfig
    extends java.lang.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
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  KVLocalConfig.Builder
      Base builder class used to set configuration parameters common to both TCP sockets and Unix domain sockets.
      static class  KVLocalConfig.InetBuilder
      InetBuilder to help construct a KVLocalConfig instance using TCP sockets.
      static class  KVLocalConfig.UnixDomainBuilder
      Builder class to help construct a KVLocalConfig instance using Unix domain sockets.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getHostName()
      Returns the host name.
      int getMemoryMB()
      Returns the memory size in MB.
      int getPort()
      Returns the port number.
      java.lang.String getRootDirectory()
      Returns the directory where NoSQL Database data is placed.
      int getStorageGB()
      Returns the storage directory size in GB.
      java.lang.String getStoreName()
      Returns the store name.
      boolean isSecure()
      Returns whether security is enabled.
      boolean isUnixDomain()
      Returns whether the configuration uses Unix domain sockets.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DEFAULT_STORENAME

        public static final java.lang.String DEFAULT_STORENAME
        The default store name is "kvstore".
        See Also:
        Constant Field Values
      • DEFAULT_STORAGE_SIZE_GB

        public static final int DEFAULT_STORAGE_SIZE_GB
        The default storage size in gigabyte is 10.
        See Also:
        Constant Field Values
      • 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:
        Constant Field Values
      • DEFAULT_PORT

        public static final int DEFAULT_PORT
        The default port number is 5000.
        See Also:
        Constant Field Values
    • Method Detail

      • toString

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

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

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

        public java.lang.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