Class ServiceConfig.Foyer

java.lang.Object
org.apache.opendal.ServiceConfig.Foyer
All Implemented Interfaces:
ServiceConfig
Enclosing interface:
ServiceConfig

public static class ServiceConfig.Foyer extends Object implements ServiceConfig
Configuration for service foyer.
  • Field Details

    • diskCapacity

      public final Long diskCapacity

      Disk cache total capacity in bytes. Only used when disk_path is set.

    • diskFileSize

      public final Long diskFileSize

      Individual cache file size in bytes.

      Default is 1 MiB. Only used when disk_path is set.

    • diskPath

      public final String diskPath

      Disk cache directory path.

      If set, enables hybrid cache with disk storage. Data will be persisted to this directory when memory cache is full.

    • memory

      public final Long memory

      Memory eviction budget in bytes for the automatically built cache.

      Each entry counts the byte length of its stored path plus the logical length of its value, with a minimum charge of one byte. The stored path includes the normalized root and omits the leading slash. Foyer can retain an entry whose weight exceeds its shard's budget. Default is 1 GiB.

    • name

      public final String name

      Name for this cache instance.

    • recoverMode

      public final String recoverMode

      Recovery mode when starting the cache.

      Valid values: "none" (default), "quiet", "strict".

      • "none": Don't recover from disk
      • "quiet": Recover and skip errors
      • "strict": Recover and panic on errors
    • root

      public final String root

      Root path of this backend.

    • shards

      public final Long shards

      Number of shards for concurrent access.

      Default is 1. Higher values improve concurrency but increase overhead.

  • Constructor Details

    • Foyer

      public Foyer()
  • Method Details

    • scheme

      public String scheme()
      Description copied from interface: ServiceConfig
      The scheme of the service.
      Specified by:
      scheme in interface ServiceConfig
      Returns:
      the scheme
    • configMap

      public Map<String,String> configMap()
      Description copied from interface: ServiceConfig
      Convert the structured config to a type erased config map.

      A map-valued field becomes one entry, under the field's option name, whose value is a JSON object string, such as assume_role_session_tags = {"Team":"data"}. The map's entries are not flattened into top-level entries. Its keys are sorted, an empty map becomes {}, and an unset field has no entry.

      Specified by:
      configMap in interface ServiceConfig
      Returns:
      the config map