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 2022/12/24 12:15:19 UTC

[GitHub] [ignite-3] PakhomovAlexander commented on a diff in pull request #1472: IGNITE-18222

PakhomovAlexander commented on code in PR #1472:
URL: https://github.com/apache/ignite-3/pull/1472#discussion_r1056805827


##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/Session.java:
##########
@@ -18,51 +18,60 @@
 package org.apache.ignite.internal.cli.core.repl;
 
 import jakarta.inject.Singleton;
+import java.util.List;
+import org.apache.ignite.internal.logger.IgniteLogger;
+import org.apache.ignite.internal.logger.Loggers;
 
 /**
- * Connection session that in fact is holder for state: connected or disconnected.
- * Also has a nodeUrl if the state is connected.
+ * Connection session that in fact is holder for state: connected or disconnected. Also has a nodeUrl if the state is connected.
  */
 @Singleton
 public class Session {
 
-    private boolean connectedToNode;
-
-    private String nodeUrl;
-
-    private String nodeName;
+    private final IgniteLogger log = Loggers.forClass(getClass());
 
-    private String jdbcUrl;
-
-    public boolean isConnectedToNode() {
-        return connectedToNode;
-    }
+    private SessionDetails sessionDetails;
 
-    public void setConnectedToNode(boolean connectedToNode) {
-        this.connectedToNode = connectedToNode;
-    }
+    private boolean connectedToNode;
 
-    public String nodeUrl() {
-        return nodeUrl;
-    }
+    private final List<SessionEventListener> listeners;
 
-    public String nodeName() {
-        return nodeName;
+    public Session(List<SessionEventListener> listeners) {
+        this.listeners = listeners;
     }
 
-    public void setNodeName(String nodeName) {
-        this.nodeName = nodeName;
+    /** Creates session details with provided nodeUrl, nodeName, jdbcUrl. */
+    public synchronized void connect(String nodeUrl, String nodeName, String jdbcUrl) {
+        this.sessionDetails = new SessionDetails(nodeUrl, nodeName, jdbcUrl);

Review Comment:
   Could you rename SessionDetails to SessionContext?



##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/SessionEventListener.java:
##########
@@ -0,0 +1,28 @@
+/*
+ * 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.internal.cli.core.repl;
+
+/** Session event listener. */
+public interface SessionEventListener {

Review Comment:
   Could you add the Async to the name?



##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/executor/ReplExecutorProvider.java:
##########
@@ -35,7 +35,7 @@ public class ReplExecutorProvider {
     private Terminal terminal;
 
     @Inject
-    private NodeNameRegistry nodeNameRegistry;
+    private NodeNameRegistryImpl nodeNameRegistry;

Review Comment:
   There are multiple places where you've renamed the `NodeNameRegistry` to `NodeNameRegistryImpl` I think this is done by mistake. Could you fix all of them?



##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/Session.java:
##########
@@ -18,51 +18,60 @@
 package org.apache.ignite.internal.cli.core.repl;
 
 import jakarta.inject.Singleton;
+import java.util.List;
+import org.apache.ignite.internal.logger.IgniteLogger;
+import org.apache.ignite.internal.logger.Loggers;
 
 /**
- * Connection session that in fact is holder for state: connected or disconnected.
- * Also has a nodeUrl if the state is connected.
+ * Connection session that in fact is holder for state: connected or disconnected. Also has a nodeUrl if the state is connected.
  */
 @Singleton
 public class Session {
 
-    private boolean connectedToNode;
-
-    private String nodeUrl;
-
-    private String nodeName;
+    private final IgniteLogger log = Loggers.forClass(getClass());

Review Comment:
   Could you please use `CliLoggers.forClass(IniConfigManager.class);` that will enable the `--verbose` output



##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/Session.java:
##########
@@ -18,51 +18,60 @@
 package org.apache.ignite.internal.cli.core.repl;
 
 import jakarta.inject.Singleton;
+import java.util.List;
+import org.apache.ignite.internal.logger.IgniteLogger;
+import org.apache.ignite.internal.logger.Loggers;
 
 /**
- * Connection session that in fact is holder for state: connected or disconnected.
- * Also has a nodeUrl if the state is connected.
+ * Connection session that in fact is holder for state: connected or disconnected. Also has a nodeUrl if the state is connected.
  */
 @Singleton
 public class Session {
 
-    private boolean connectedToNode;
-
-    private String nodeUrl;
-
-    private String nodeName;
+    private final IgniteLogger log = Loggers.forClass(getClass());
 
-    private String jdbcUrl;
-
-    public boolean isConnectedToNode() {
-        return connectedToNode;
-    }
+    private SessionDetails sessionDetails;
 
-    public void setConnectedToNode(boolean connectedToNode) {
-        this.connectedToNode = connectedToNode;
-    }
+    private boolean connectedToNode;
 
-    public String nodeUrl() {
-        return nodeUrl;
-    }
+    private final List<SessionEventListener> listeners;
 
-    public String nodeName() {
-        return nodeName;
+    public Session(List<SessionEventListener> listeners) {
+        this.listeners = listeners;
     }
 
-    public void setNodeName(String nodeName) {
-        this.nodeName = nodeName;
+    /** Creates session details with provided nodeUrl, nodeName, jdbcUrl. */
+    public synchronized void connect(String nodeUrl, String nodeName, String jdbcUrl) {
+        this.sessionDetails = new SessionDetails(nodeUrl, nodeName, jdbcUrl);
+        this.connectedToNode = true;
+        listeners.forEach(it -> {
+            try {
+                it.onConnect(this);
+            } catch (Exception e) {
+                log.warn("Got an exception: ", e);
+            }
+        });
     }
 
-    public void setNodeUrl(String nodeUrl) {
-        this.nodeUrl = nodeUrl;
+    /** Clears session details and sets false to connectedToNode. */
+    public synchronized void disconnect() {
+        this.sessionDetails = new SessionDetails();
+        this.connectedToNode = false;
+        listeners.forEach(it -> {
+            try {
+                it.onConnect(this);
+            } catch (Exception e) {
+                log.warn("Got an exception: ", e);
+            }
+        });
     }
 
-    public String jdbcUrl() {
-        return jdbcUrl;
+    public boolean isConnectedToNode() {
+        return connectedToNode;
     }
 
-    public void setJdbcUrl(String jdbcUrl) {
-        this.jdbcUrl = jdbcUrl;
+    /** Returns {@link SessionDetails}. */
+    public SessionDetails sessionDetails() {

Review Comment:
   sessionDetails -> details



##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/Session.java:
##########
@@ -18,51 +18,60 @@
 package org.apache.ignite.internal.cli.core.repl;
 
 import jakarta.inject.Singleton;
+import java.util.List;
+import org.apache.ignite.internal.logger.IgniteLogger;
+import org.apache.ignite.internal.logger.Loggers;
 
 /**
- * Connection session that in fact is holder for state: connected or disconnected.
- * Also has a nodeUrl if the state is connected.
+ * Connection session that in fact is holder for state: connected or disconnected. Also has a nodeUrl if the state is connected.
  */
 @Singleton
 public class Session {
 
-    private boolean connectedToNode;
-
-    private String nodeUrl;
-
-    private String nodeName;
+    private final IgniteLogger log = Loggers.forClass(getClass());
 
-    private String jdbcUrl;
-
-    public boolean isConnectedToNode() {
-        return connectedToNode;
-    }
+    private SessionDetails sessionDetails;
 
-    public void setConnectedToNode(boolean connectedToNode) {
-        this.connectedToNode = connectedToNode;
-    }
+    private boolean connectedToNode;
 
-    public String nodeUrl() {
-        return nodeUrl;
-    }
+    private final List<SessionEventListener> listeners;
 
-    public String nodeName() {
-        return nodeName;
+    public Session(List<SessionEventListener> listeners) {
+        this.listeners = listeners;
     }
 
-    public void setNodeName(String nodeName) {
-        this.nodeName = nodeName;
+    /** Creates session details with provided nodeUrl, nodeName, jdbcUrl. */
+    public synchronized void connect(String nodeUrl, String nodeName, String jdbcUrl) {
+        this.sessionDetails = new SessionDetails(nodeUrl, nodeName, jdbcUrl);
+        this.connectedToNode = true;
+        listeners.forEach(it -> {
+            try {
+                it.onConnect(this);
+            } catch (Exception e) {
+                log.warn("Got an exception: ", e);
+            }
+        });
     }
 
-    public void setNodeUrl(String nodeUrl) {
-        this.nodeUrl = nodeUrl;
+    /** Clears session details and sets false to connectedToNode. */
+    public synchronized void disconnect() {
+        this.sessionDetails = new SessionDetails();
+        this.connectedToNode = false;
+        listeners.forEach(it -> {
+            try {
+                it.onConnect(this);

Review Comment:
   `onDisconnect` maybe?



##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/core/JdbcUrl.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * 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.internal.cli.core;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/** Representation of Ignite JDBC url. */
+public class JdbcUrl {
+    private final String host;
+    private final int port;
+
+    /** Constructor. */
+    private JdbcUrl(String host, int port) {
+        this.host = host;
+        this.port = port;
+    }
+
+    /** Returns {@link JdbcUrl} with provided host and port. */
+    public static JdbcUrl of(String url, int port) throws MalformedURLException {
+        return new JdbcUrl(new URL(url).getHost(), port);
+    }
+
+    public String toString() {

Review Comment:
   add Override annotation please



##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/completer/path/FilePathDynamicCompleterFactory.java:
##########
@@ -0,0 +1,31 @@
+/*
+ * 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.internal.cli.core.repl.completer.path;
+
+import jakarta.inject.Singleton;
+import org.apache.ignite.internal.cli.core.repl.completer.DynamicCompleter;
+import org.apache.ignite.internal.cli.core.repl.completer.DynamicCompleterFactory;
+
+/** Factory for file path option completer. */
+@Singleton
+public class FilePathDynamicCompleterFactory implements DynamicCompleterFactory {

Review Comment:
   I think if the implementation of completer factory is so simple that can be a lambda – it should be a lambda.



##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/registry/impl/JdbcUrlRegistryImpl.java:
##########
@@ -0,0 +1,107 @@
+/*
+ * 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.internal.cli.core.repl.registry.impl;
+
+import com.google.gson.Gson;
+import jakarta.inject.Singleton;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+import org.apache.ignite.internal.cli.core.JdbcUrl;
+import org.apache.ignite.internal.cli.core.repl.Session;
+import org.apache.ignite.internal.cli.core.repl.SessionEventListener;
+import org.apache.ignite.internal.cli.core.repl.config.RootConfig;
+import org.apache.ignite.internal.cli.core.repl.registry.JdbcUrlRegistry;
+import org.apache.ignite.internal.logger.IgniteLogger;
+import org.apache.ignite.internal.logger.Loggers;
+import org.apache.ignite.internal.thread.NamedThreadFactory;
+import org.apache.ignite.rest.client.api.NodeConfigurationApi;
+import org.apache.ignite.rest.client.invoker.ApiException;
+import org.apache.ignite.rest.client.invoker.Configuration;
+
+/** Implementation of {@link JdbcUrlRegistry}. */
+@Singleton
+public class JdbcUrlRegistryImpl implements JdbcUrlRegistry, SessionEventListener {
+
+    private final IgniteLogger log = Loggers.forClass(getClass());

Review Comment:
   CliLoggers



##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/Session.java:
##########
@@ -18,51 +18,60 @@
 package org.apache.ignite.internal.cli.core.repl;
 
 import jakarta.inject.Singleton;
+import java.util.List;
+import org.apache.ignite.internal.logger.IgniteLogger;
+import org.apache.ignite.internal.logger.Loggers;
 
 /**
- * Connection session that in fact is holder for state: connected or disconnected.
- * Also has a nodeUrl if the state is connected.
+ * Connection session that in fact is holder for state: connected or disconnected. Also has a nodeUrl if the state is connected.
  */
 @Singleton
 public class Session {
 
-    private boolean connectedToNode;
-
-    private String nodeUrl;
-
-    private String nodeName;
+    private final IgniteLogger log = Loggers.forClass(getClass());
 
-    private String jdbcUrl;
-
-    public boolean isConnectedToNode() {
-        return connectedToNode;
-    }
+    private SessionDetails sessionDetails;
 
-    public void setConnectedToNode(boolean connectedToNode) {
-        this.connectedToNode = connectedToNode;
-    }
+    private boolean connectedToNode;
 
-    public String nodeUrl() {
-        return nodeUrl;
-    }
+    private final List<SessionEventListener> listeners;
 
-    public String nodeName() {
-        return nodeName;
+    public Session(List<SessionEventListener> listeners) {
+        this.listeners = listeners;
     }
 
-    public void setNodeName(String nodeName) {
-        this.nodeName = nodeName;
+    /** Creates session details with provided nodeUrl, nodeName, jdbcUrl. */
+    public synchronized void connect(String nodeUrl, String nodeName, String jdbcUrl) {
+        this.sessionDetails = new SessionDetails(nodeUrl, nodeName, jdbcUrl);

Review Comment:
   Maybe it would be more readable to put SessionDetails to the method signature?



##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/Session.java:
##########
@@ -18,51 +18,60 @@
 package org.apache.ignite.internal.cli.core.repl;
 
 import jakarta.inject.Singleton;
+import java.util.List;
+import org.apache.ignite.internal.logger.IgniteLogger;
+import org.apache.ignite.internal.logger.Loggers;
 
 /**
- * Connection session that in fact is holder for state: connected or disconnected.
- * Also has a nodeUrl if the state is connected.
+ * Connection session that in fact is holder for state: connected or disconnected. Also has a nodeUrl if the state is connected.
  */
 @Singleton
 public class Session {
 
-    private boolean connectedToNode;
-
-    private String nodeUrl;
-
-    private String nodeName;
+    private final IgniteLogger log = Loggers.forClass(getClass());
 
-    private String jdbcUrl;
-
-    public boolean isConnectedToNode() {
-        return connectedToNode;
-    }
+    private SessionDetails sessionDetails;
 
-    public void setConnectedToNode(boolean connectedToNode) {
-        this.connectedToNode = connectedToNode;
-    }
+    private boolean connectedToNode;
 
-    public String nodeUrl() {
-        return nodeUrl;
-    }
+    private final List<SessionEventListener> listeners;
 
-    public String nodeName() {
-        return nodeName;
+    public Session(List<SessionEventListener> listeners) {
+        this.listeners = listeners;
     }
 
-    public void setNodeName(String nodeName) {
-        this.nodeName = nodeName;
+    /** Creates session details with provided nodeUrl, nodeName, jdbcUrl. */
+    public synchronized void connect(String nodeUrl, String nodeName, String jdbcUrl) {
+        this.sessionDetails = new SessionDetails(nodeUrl, nodeName, jdbcUrl);
+        this.connectedToNode = true;
+        listeners.forEach(it -> {
+            try {
+                it.onConnect(this);
+            } catch (Exception e) {
+                log.warn("Got an exception: ", e);
+            }
+        });
     }
 
-    public void setNodeUrl(String nodeUrl) {
-        this.nodeUrl = nodeUrl;
+    /** Clears session details and sets false to connectedToNode. */
+    public synchronized void disconnect() {
+        this.sessionDetails = new SessionDetails();
+        this.connectedToNode = false;
+        listeners.forEach(it -> {
+            try {
+                it.onConnect(this);
+            } catch (Exception e) {
+                log.warn("Got an exception: ", e);
+            }
+        });
     }
 
-    public String jdbcUrl() {
-        return jdbcUrl;
+    public boolean isConnectedToNode() {

Review Comment:
   isConnectedToNode -> connected



##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/registry/impl/JdbcUrlRegistryImpl.java:
##########
@@ -0,0 +1,107 @@
+/*
+ * 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.internal.cli.core.repl.registry.impl;
+
+import com.google.gson.Gson;
+import jakarta.inject.Singleton;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+import org.apache.ignite.internal.cli.core.JdbcUrl;
+import org.apache.ignite.internal.cli.core.repl.Session;
+import org.apache.ignite.internal.cli.core.repl.SessionEventListener;
+import org.apache.ignite.internal.cli.core.repl.config.RootConfig;
+import org.apache.ignite.internal.cli.core.repl.registry.JdbcUrlRegistry;
+import org.apache.ignite.internal.logger.IgniteLogger;
+import org.apache.ignite.internal.logger.Loggers;
+import org.apache.ignite.internal.thread.NamedThreadFactory;
+import org.apache.ignite.rest.client.api.NodeConfigurationApi;
+import org.apache.ignite.rest.client.invoker.ApiException;
+import org.apache.ignite.rest.client.invoker.Configuration;
+
+/** Implementation of {@link JdbcUrlRegistry}. */
+@Singleton
+public class JdbcUrlRegistryImpl implements JdbcUrlRegistry, SessionEventListener {
+
+    private final IgniteLogger log = Loggers.forClass(getClass());
+    private final NodeNameRegistryImpl nodeNameRegistry;
+    private volatile Set<JdbcUrl> jdbcUrls = Set.of();

Review Comment:
   `JdbcUrl` should implement `equals` and `hashcode`.



##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/completer/DynamicCompleterActivationPoint.java:
##########
@@ -86,5 +97,28 @@ public void activateDynamicCompleter(DynamicCompleterRegistry registry) {
                         .build(),
                 nodeNameDynamicCompleterFactory
         );
+
+        registry.register(
+                CompleterConf.builder()
+                        .command("sql")
+                        .enableOptions(Options.SCRIPT_FILE)
+                        .exclusiveEnableOptions().build(),
+                filePathDynamicCompleterFactory
+        );
+
+        registry.register(
+                CompleterConf.builder()
+                        .command("sql")
+                        .enableOptions(Options.JDBC_URL)
+                        .exclusiveEnableOptions().build(),
+                jdbcUrlDynamicCompleterFactory
+        );
+
+        registry.register(
+                CompleterConf.builder()
+                        .enableOptions(Options.CLUSTER_URL)

Review Comment:
   What about `Options.NODE_URL`?



##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/registry/impl/JdbcUrlRegistryImpl.java:
##########
@@ -0,0 +1,107 @@
+/*
+ * 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.internal.cli.core.repl.registry.impl;
+
+import com.google.gson.Gson;
+import jakarta.inject.Singleton;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+import org.apache.ignite.internal.cli.core.JdbcUrl;
+import org.apache.ignite.internal.cli.core.repl.Session;
+import org.apache.ignite.internal.cli.core.repl.SessionEventListener;
+import org.apache.ignite.internal.cli.core.repl.config.RootConfig;
+import org.apache.ignite.internal.cli.core.repl.registry.JdbcUrlRegistry;
+import org.apache.ignite.internal.logger.IgniteLogger;
+import org.apache.ignite.internal.logger.Loggers;
+import org.apache.ignite.internal.thread.NamedThreadFactory;
+import org.apache.ignite.rest.client.api.NodeConfigurationApi;
+import org.apache.ignite.rest.client.invoker.ApiException;
+import org.apache.ignite.rest.client.invoker.Configuration;
+
+/** Implementation of {@link JdbcUrlRegistry}. */
+@Singleton
+public class JdbcUrlRegistryImpl implements JdbcUrlRegistry, SessionEventListener {
+
+    private final IgniteLogger log = Loggers.forClass(getClass());
+    private final NodeNameRegistryImpl nodeNameRegistry;
+    private volatile Set<JdbcUrl> jdbcUrls = Set.of();

Review Comment:
   I don't think the `volatile` is the best choice here. Maybe `ConcurrentHashSet`?



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org