Class UCConfigUtils

Object
io.delta.storage.commit.uccommitcoordinator.UCConfigUtils

public final class UCConfigUtils extends Object
Shared utility methods for parsing flat UC configuration maps (e.g. auth, appVersions). Used by both the Scala factory (UCTokenBasedRestClientFactory) and the Java client (UCDeltaTokenBasedRestClient).

Config key names are the single source of truth and must stay aligned with OSS Unity Catalog.

  • Field Details

  • Method Details

    • extractUri

      public static String extractUri(Map<String,String> ucConfig)
      Extracts the required uri value from a flat ucConfig map.
      Throws:
      IllegalArgumentException - if uri is not present.
    • extractAuthConfig

      public static Map<String,String> extractAuthConfig(Map<String,String> ucConfig)
      Extracts authentication configuration from a flat ucConfig map. The auth. prefix is stripped while the suffix (e.g. oauth.clientId) is preserved so downstream lookups match exactly. Prefers auth.* keys; falls back to the legacy token key.
      Parameters:
      ucConfig - the flat configuration map.
      Returns:
      a map suitable for TokenProvider.create, with the auth. prefix stripped.
    • hasAuthConfig

      public static boolean hasAuthConfig(Map<String,String> ucConfig)
      Returns true if the ucConfig contains any authentication configuration (auth.* keys or legacy token key).
    • extractAppVersions

      public static Map<String,String> extractAppVersions(Map<String,String> ucConfig)
      Extracts appVersions.* entries from a flat ucConfig map, stripping the prefix.
      Parameters:
      ucConfig - the flat configuration map.
      Returns:
      a map of application name to version string.
    • isDeltaRestApiEnabled

      public static boolean isDeltaRestApiEnabled(Map<String,String> ucConfig)
      Returns whether the Delta REST API client should be used. Defaults to true when the key is absent.
    • isCredentialVendingEnabled

      public static boolean isCredentialVendingEnabled(Map<String,String> ucConfig)
      Returns whether table operations should vend temporary storage credentials. Defaults to true when the key is absent.
    • isCredentialRenewalEnabled

      public static boolean isCredentialRenewalEnabled(Map<String,String> ucConfig)
      Returns whether credential renewal is enabled. Defaults to true when the key is absent.
    • isCredentialScopedFsEnabled

      public static boolean isCredentialScopedFsEnabled(Map<String,String> ucConfig)
      Returns whether credential-scoped filesystem access is enabled. Defaults to true when the key is absent.
    • parseBoolean

      public static boolean parseBoolean(Map<String,String> ucConfig, String key, boolean defaultValue)
      Parses a boolean config value with a default fallback. Only "true" / "false" (case-insensitive) are accepted; any other value throws so misconfigured keys surface loudly rather than silently falling back.
      Throws:
      IllegalArgumentException - if the value is present but not a valid boolean.