You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/04/02 15:51:35 UTC

[GitHub] [ignite-3] ibessonov opened a new pull request #81: IGNITE-14372 REST updates fixes.

ibessonov opened a new pull request #81:
URL: https://github.com/apache/ignite-3/pull/81


   Signed-off-by: ibessonov <be...@gmail.com>


-- 
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:
users@infra.apache.org



[GitHub] [ignite-3] ibessonov commented on a change in pull request #81: IGNITE-14372 REST updates fixes.

Posted by GitBox <gi...@apache.org>.
ibessonov commented on a change in pull request #81:
URL: https://github.com/apache/ignite-3/pull/81#discussion_r616717987



##########
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:
       I'll change the message. List of roots and more details will be added in future.




-- 
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:
users@infra.apache.org



[GitHub] [ignite-3] ibessonov commented on a change in pull request #81: IGNITE-14372 REST updates fixes.

Posted by GitBox <gi...@apache.org>.
ibessonov commented on a change in pull request #81:
URL: https://github.com/apache/ignite-3/pull/81#discussion_r616616010



##########
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:
       Well, this is a temporary thing for node bootstrap. Maybe we will actually delete this parameter in the future.




-- 
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:
users@infra.apache.org



[GitHub] [ignite-3] sergey-chugunov-1985 commented on a change in pull request #81: IGNITE-14372 REST updates fixes.

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [ignite-3] ibessonov merged pull request #81: IGNITE-14372 REST updates fixes.

Posted by GitBox <gi...@apache.org>.
ibessonov merged pull request #81:
URL: https://github.com/apache/ignite-3/pull/81


   


-- 
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:
users@infra.apache.org