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/01/22 06:44:06 UTC

[GitHub] [ignite-3] sergey-chugunov-1985 commented on a change in pull request #14: IGNITE-13836 First implementation of multi-root support for independent modules configurations

sergey-chugunov-1985 commented on a change in pull request #14:
URL: https://github.com/apache/ignite-3/pull/14#discussion_r562418531



##########
File path: modules/configuration/src/main/java/org/apache/ignite/configuration/presentation/json/JsonConverter.java
##########
@@ -43,6 +44,15 @@
         return gson.toJson(res);
     }
 
+    /** {@inheritDoc} */
+    @Override public String rootName(String source) {

Review comment:
       Yes, it cannot work with an update request packing more than one root. We may reconsider and change this in the future.

##########
File path: modules/runner/pom.xml
##########
@@ -64,6 +58,12 @@
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-rest</artifactId>
+            <version>3.0-SNAPSHOT</version>

Review comment:
       Fixed.

##########
File path: modules/configuration/src/main/java/org/apache/ignite/configuration/SystemConfiguration.java
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.configuration;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.ignite.configuration.internal.DynamicConfiguration;
+import org.apache.ignite.configuration.presentation.json.JsonPresentation;
+
+/** */
+public class SystemConfiguration {

Review comment:
       Agree, ConfiguratorRegistry name sounds more descriptive, renamed.

##########
File path: modules/configuration/src/main/java/org/apache/ignite/configuration/SystemConfiguration.java
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.configuration;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.ignite.configuration.internal.DynamicConfiguration;
+import org.apache.ignite.configuration.presentation.json.JsonPresentation;
+
+/** */
+public class SystemConfiguration {
+    /** */
+    private final Map<String, Configurator<?>> configs = new HashMap<>();
+
+    /** */
+    private final Map<String, ConfigurationTree<?, ?>> multirootConfiguration = new HashMap<>();
+
+    /** */
+    private final ConfigurationPresentation<String> presentation = new JsonPresentation(configs);
+
+    /** */
+    public <T extends DynamicConfiguration<?, ?, ?>> void registerConfigurator(Configurator<T> unitConfig) {
+        String key = unitConfig.getRoot().key();
+
+        configs.put(key, unitConfig);
+
+        multirootConfiguration.put(key, unitConfig.getRoot());
+    }
+
+    /** */
+    public <V, C, T extends ConfigurationTree<V, C>> T getConfiguration(RootKey<T> rootKey) {
+        return (T) multirootConfiguration.get(rootKey.key());
+    }
+
+    /** */
+    public ConfigurationPresentation<String> presentation() {

Review comment:
       Removed this method, now rest module uses ConfigurationPresentation object directly.




----------------------------------------------------------------
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