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 Object
Base builder class used to set configuration parameters common to both TCP sockets and Unix domain sockets.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder(String rootDir)`
  Makes a builder for KVLocalConfig with the specified root directory.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract KVLocalConfig`
  `build()`
  Builds a `KVLocalConfig` instance using the values specified in this builder.
  `abstract KVLocalConfig.Builder`
  `isSecure(boolean secure)`
  Specifies whether the store is secure.
  `abstract KVLocalConfig.Builder`
  `setHostName(String name)`
  Sets the host name.
  `KVLocalConfig.Builder`
  `setMemoryMB(int mb)`
  Sets the memory size in megabytes.
  `abstract KVLocalConfig.Builder`
  `setPort(int portNum)`
  Sets port number.
  `KVLocalConfig.Builder`
  `setStorageGB(int gb)`
  Sets the storage directory size in gigabytes.
  `KVLocalConfig.Builder`
  `setStoreName(String name)`
  Sets store name.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Builder

    public Builder(String rootDir)
    Makes a builder for KVLocalConfig with the specified root directory.
    Parameters:
      `rootDir` - the root directory where NoSQL Database data is placed
    Throws:
      `IllegalArgumentException` - if specified rootDir is null or empty

- ## Method Details

  - ### setStoreName

    public KVLocalConfig.Builder setStoreName(String name)
    Sets store name.
    Parameters:
      `name` - the name of the store
    Returns:
      this instance
    Throws:
      `IllegalArgumentException` - if store name is null or empty

  - ### setHostName

    public abstract KVLocalConfig.Builder setHostName(String name)
    Sets the host name.
    Parameters:
      `name` - the name of the host
    Returns:
      this instance
    Throws:
      `IllegalArgumentException` - if host name is null or empty
      `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:
      `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:
      `IllegalArgumentException` - if the storage directory size is negative

  - ### build

    public abstract KVLocalConfig build()
    Builds a `KVLocalConfig` instance using the values specified in this builder.
    Returns:
      a `KVLocalConfig` instance 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:
      `IllegalArgumentException` - if the port number is not in the range 0 to 65535
      `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:
      `UnsupportedOperationException` - if this builder does not support enabling or disabling security