Class DynamicConfigApplier
java.lang.Object
com.loomcache.server.config.DynamicConfigApplier
Applies dynamic configuration changes to running components without requiring restart.
Built-in configuration keys:
- cache.max-size - maximum number of entries in cache
- cache.eviction-policy - eviction policy (LRU, LFU, FIFO)
- cache.ttl-default-ms - default TTL for cache entries
- network.max-connections - maximum concurrent connections
- network.read-timeout-ms - socket read timeout
- security.rate-limit-per-second - rate limit for requests
- log.level - logging level (DEBUG, INFO, WARN, ERROR)
Uses pattern matching on namespace to route changes to correct handlers. Supports rollback on failure.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctional interface for applying configuration changes. -
Constructor Summary
ConstructorsConstructorDescriptionDynamicConfigApplier(ClusterConfigManager configManager) Create a new DynamicConfigApplier. -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplyChange(String key, @Nullable String oldValue, String newValue) Apply a configuration change, with automatic rollback on failure.Create a config change listener that applies changes dynamically.voidregisterHandler(String key, DynamicConfigApplier.ConfigChangeHandler handler) Register a handler for a configuration key.booleanRollback a configuration change.
-
Constructor Details
-
DynamicConfigApplier
Create a new DynamicConfigApplier.- Parameters:
configManager- the cluster config manager
-
-
Method Details
-
registerHandler
Register a handler for a configuration key.- Parameters:
key- the configuration keyhandler- the handler function
-
applyChange
-
rollback
Rollback a configuration change.- Parameters:
key- the configuration key to rollback- Returns:
- true if rollback succeeded, false otherwise
-
createApplierListener
Create a config change listener that applies changes dynamically.- Returns:
- a ConfigChangeListener that applies changes
-