sergey-chugunov-1985 commented on a change in pull request #81:
URL: https://github.com/apache/ignite-3/pull/81#discussion_r616594987
##########
File path:
modules/configuration/src/main/java/org/apache/ignite/configuration/ConfigurationChanger.java
##########
@@ -210,19 +212,42 @@ public void initialize(ConfigurationType storageType) {
}
}
- /** Temporary until the IGNITE-14372 */
- public CompletableFuture<?> changeX(
- List<String> path,
+ /** */
+ public CompletableFuture<Void> change(
ConfigurationSource source,
ConfigurationStorage storage
Review comment:
Why do we need this `storage` at all? Can we calculate the correct
storage internally based only on passed source?
##########
File path:
modules/configuration/src/main/java/org/apache/ignite/configuration/ConfigurationChanger.java
##########
@@ -210,19 +212,42 @@ public void initialize(ConfigurationType storageType) {
}
}
- /** Temporary until the IGNITE-14372 */
- public CompletableFuture<?> changeX(
- List<String> path,
+ /** */
+ public CompletableFuture<Void> change(
ConfigurationSource source,
ConfigurationStorage storage
) {
- assert path.isEmpty() : "Path support is not yet implemented.";
-
SuperRoot superRoot = new SuperRoot(rootKeys);
source.descend(superRoot);
- return changeInternally(superRoot, storage);
+ Set<ConfigurationType> storagesTypes = new HashSet<>();
+
+ superRoot.traverseChildren(new ConfigurationVisitor<Object>() {
+ @Override public Object visitInnerNode(String key, InnerNode node)
{
+ RootKey<?, ?> rootKey = rootKeys.get(key);
+
+ return storagesTypes.add(rootKey.type());
+ }
+ });
+
+ assert !storagesTypes.isEmpty();
+
+ if (storagesTypes.size() != 1) {
+ return CompletableFuture.failedFuture(
+ new ConfigurationChangeException("Cannot change configurations
belonging to different storages.")
Review comment:
How about message like `Cannot handle change request with configuration
patches belonging to different storages.`?
Also it would be great if we can add some information about which
configuration roots are involved in the situation (I think we can gather this
information when traversing children of superRoot).
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]