Class PropertiesConfigLoader
This loader supports hierarchical Java properties format (not YAML): loomcache.node-id=node-1 loomcache.node.host=node-1.internal.example.com loomcache.bind-address=0.0.0.0 loomcache.port=5701 loomcache.cluster.seeds=host1:5701,host2:5702 loomcache.raft.election-timeout-ms=60000 etc. loomcache.auth.jaas.enabled=true loomcache.auth.jaas.login-context=LoomCache loomcache.auth.jaas.login-module.0.class=com.example.security.LoomLoginModule loomcache.auth.jaas.login-module.0.flag=required loomcache.auth.jaas.login-module.0.option.users-file=/etc/loomcache/users.properties loomcache.auth.ldap.enabled=true loomcache.auth.ldap.user-provider=ldap://ldap.example.com/ou=people,dc=example,dc=com loomcache.auth.ldap.auth-identity=uid={USERNAME},ou=people,dc=example,dc=com loomcache.auth.kerberos.enabled=true loomcache.auth.kerberos.login-module-class=com.sun.security.auth.module.Krb5LoginModule loomcache.auth.kerberos.principal=loomcache/[email protected] loomcache.auth.kerberos.key-tab=/etc/security/keytabs/loomcache.keytab loomcache.auth.token.enabled=true loomcache.auth.token.credentials.ci-bot.sha256=invalid input: '<'sha256-token-fingerprint> loomcache.auth.token.credentials.ci-bot.username=ci-bot loomcache.auth.token.credentials.ci-bot.roles=admin loomcache.executor.max-task-payload-bytes=1048576 loomcache.server.executor.max-task-payload-bytes=1048576
Configuration sources (in priority order):
- CLI arguments (passed to builder)
- File specified by --config=path argument
- ./loomcache.properties in current directory
- loomcache.properties from classpath
- Built-in defaults
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LoomConfig.BuilderloadConfig(@Nullable String configFilePath) Load configuration from multiple sources, with proper precedence.static voidvalidateConfiguration(LoomConfig config) Backwards-compatible overload that defers tovalidateConfiguration(LoomConfig, boolean)withallowStandalone=false.static voidvalidateConfiguration(LoomConfig config, boolean allowStandalone) Validate the resolved configuration and perform startup checks.
-
Constructor Details
-
PropertiesConfigLoader
public PropertiesConfigLoader()
-
-
Method Details
-
loadConfig
Load configuration from multiple sources, with proper precedence.- Parameters:
configFilePath- optional path to config file (null to use defaults)- Returns:
- LoomConfig.Builder with loaded properties
-
validateConfiguration
Validate the resolved configuration and perform startup checks.BLK-2026-04-22-009: previously these checks only logged warnings, so a misconfigured deployment (port already bound, unwritable WAL dir, empty seed list) would still attempt to boot — and either crash later in opaque ways or, worse, silently come up as a single-node cluster on its own. This method now fails fast.
Standalone-mode (empty seed list) is permitted only if
allowStandaloneis true, which is opt-in via--allow-standaloneon theCacheNodeMainCLI.- Parameters:
config- The resolved configurationallowStandalone- Whether an empty cluster-members list is permitted- Throws:
IllegalStateException- if validation fails
-
validateConfiguration
Backwards-compatible overload that defers tovalidateConfiguration(LoomConfig, boolean)withallowStandalone=false. Existing call sites that have not opted into the stricter contract get the safe default.- Parameters:
config- The resolved configuration- Throws:
IllegalStateException- if validation fails
-