pauloricardomg opened a new pull request, #358:
URL: https://github.com/apache/cassandra-sidecar/pull/358

   ## Summary
   
   Implement the basic GET configuration flow in the Configuration Manager. 
When handling retrieval requests, the manager fetches the current overlay from 
the `ConfigurationProvider`, merges it with the base template to compute the 
effective configuration, and returns the result with its SHA-256 hash and last 
modified timestamp.
   
   ### New classes
   
   - **`ConfigurationManager`**: Retrieves effective configuration by loading 
the base template via `ConfigUtils.loadConfiguration` and merging it with the 
provider overlay via `ConfigurationOverlaySnapshot.overlay()`. Wraps provider 
failures in `ConfigurationManagerException`.
   - **`ConfigurationManagerException`**: Unchecked exception wrapping provider 
failures with a descriptive message.
   - **`ConfigUtils`**: Utilities for YAML loading (`loadYaml`), deep merge of 
configurations (`mergeConfigurations`), and loading a YAML file as a 
`ConfigurationOverlaySnapshot` (`loadConfiguration`).
   
   ### Changes to existing classes
   
   - **`ConfigurationOverlaySnapshot`**: Adds an `overlay()` method that 
produces a new snapshot by deep-merging another snapshot on top, combining 
`cassandraYaml` recursively, merging `extraJvmOpts`, and using the max of both 
`lastModified` timestamps. Renames `overlay` field/accessor to `configuration` 
to better reflect its role when representing the effective (merged) 
configuration.
   
   ## Test plan
   
   - [ ] `ConfigurationManagerTest`: Verifies effective configuration retrieval 
with no overlay, with overlay (merge semantics), and provider failure 
propagation
   - [ ] `ConfigUtilsTest`: Verifies YAML loading, deep merge logic (overlay 
wins, new keys, nested objects, empty overlay), and `loadConfiguration` 
snapshot creation
   - [ ] `ConfigurationOverlaySnapshotTest`: Verifies `overlay()` merge of yaml 
keys, JVM opts, max lastModified, and deep nested object merging
   - [ ] `FileBasedConfigurationProviderTest`: Updated to use renamed 
`configuration()` accessor
   - [ ] Run `./gradlew :server:test --tests 
"org.apache.cassandra.sidecar.configmanagement.*"` - all 50 tests pass


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to