PakhomovAlexander commented on code in PR #1267: URL: https://github.com/apache/ignite-3/pull/1267#discussion_r1015020219
########## modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/Await.java: ########## @@ -0,0 +1,49 @@ +/* + * 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; + +import java.time.Duration; +import java.util.function.Supplier; + +/** Utility class to await some condition. */ +public final class Await { + + private Await() { + } + + /** Awaits a condition. */ + public static void await(Supplier<Boolean> supplier, Duration timeout) { + long startTime = System.currentTimeMillis(); Review Comment: `System.currentTimeMillis()` ask the system time API that might return a number that is less than the previous one. If you want to measure the time you'd better use `System.nanoTime()` is not dependent on system time. ########## modules/api/src/main/java/org/apache/ignite/network/NodeMetadata.java: ########## @@ -0,0 +1,72 @@ +/* + * 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.network; + +import java.io.Serializable; +import java.util.Objects; + +/** + * Contains metadata of the cluster node. + */ +public class NodeMetadata implements Serializable { + private static final long serialVersionUID = 3216463261002854096L; + + private String restHost; + private int restPort; Review Comment: There should be an empty line between fields declarations. ########## modules/cli/src/main/java/org/apache/ignite/internal/cli/NodeNameRegistry.java: ########## @@ -0,0 +1,113 @@ +/* + * 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; + +import jakarta.inject.Singleton; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; +import org.apache.ignite.internal.cli.call.cluster.topology.PhysicalTopologyCall; +import org.apache.ignite.internal.cli.core.call.UrlCallInput; +import org.apache.ignite.rest.client.model.NodeMetadata; + +/** + * Registry to get a node URL by a node name. + */ +@Singleton +public class NodeNameRegistry { + private final Map<String, String> nodeNameToNodeUrl = new ConcurrentHashMap<>(); + private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock(); + private volatile ScheduledExecutorService executor; + + /** + * Start pulling updates from a node. + * + * @param nodeUrl Node URL. + */ + public void startPullingUpdates(String nodeUrl) { + stopPullingUpdates(); + synchronized (this) { + if (executor == null) { + executor = Executors.newScheduledThreadPool(1); + executor.scheduleWithFixedDelay(() -> updateNodeNames(nodeUrl), 0, 5, TimeUnit.SECONDS); + } + } + } + + /** + * Stops pulling updates. Review Comment: `Stop` according to the previous javadoc. ########## modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/NodeNameTest.java: ########## @@ -0,0 +1,97 @@ +/* + * 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.commands; + +import static org.junit.jupiter.api.Assertions.assertAll; + +import jakarta.inject.Inject; +import java.time.Duration; +import java.util.Optional; +import org.apache.ignite.internal.cli.Await; +import org.apache.ignite.internal.cli.NodeNameRegistry; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +/** Tests for ignite node commands with a provided node name. */ +public class NodeNameTest extends CliCommandTestNotInitializedIntegrationBase { + + @Inject + NodeNameRegistry nodeNameRegistry; + private String nodeName; Review Comment: I'd better remove `private` or add it to the previous field declaration. ########## modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/completer/DynamicCompleterFactory.java: ########## @@ -89,4 +93,13 @@ public LazyDynamicCompleter clusterConfigCompleter(Set<String> activationPrefixe } }); } + + public LazyDynamicCompleter nodeNameCompleter(String... activationPrefixes) { Review Comment: Return DynamicCompleter, not lazy ########## modules/cli/src/main/java/org/apache/ignite/internal/cli/commands/node/NodeUrlMixin.java: ########## @@ -17,23 +17,62 @@ package org.apache.ignite.internal.cli.commands.node; +import static org.apache.ignite.internal.cli.commands.OptionsConstants.NODE_NAME_DESC; +import static org.apache.ignite.internal.cli.commands.OptionsConstants.NODE_NAME_OPTION; +import static org.apache.ignite.internal.cli.commands.OptionsConstants.NODE_NAME_OPTION_SHORT; import static org.apache.ignite.internal.cli.commands.OptionsConstants.NODE_URL_DESC; import static org.apache.ignite.internal.cli.commands.OptionsConstants.NODE_URL_OPTION; import static org.apache.ignite.internal.cli.commands.OptionsConstants.URL_OPTION_SHORT; +import jakarta.inject.Inject; import java.net.URL; +import org.apache.ignite.internal.cli.NodeNameRegistry; import org.apache.ignite.internal.cli.core.converters.UrlConverter; +import org.apache.ignite.internal.cli.deprecated.IgniteCliException; +import picocli.CommandLine.ArgGroup; import picocli.CommandLine.Option; /** * Mixin class for node URL option. */ public class NodeUrlMixin { - /** Node URL option. */ - @Option(names = {URL_OPTION_SHORT, NODE_URL_OPTION}, description = NODE_URL_DESC, converter = UrlConverter.class) - private URL nodeUrl; + @ArgGroup + private Options options; + + @Inject + NodeNameRegistry nodeNameRegistry; + + private static class Options { + + /** + * Node URL option. + */ + @Option(names = {URL_OPTION_SHORT, NODE_URL_OPTION}, description = NODE_URL_DESC, converter = UrlConverter.class) + private URL nodeUrl; + + /** + * Node name option. + */ + @Option(names = {NODE_NAME_OPTION_SHORT, NODE_NAME_OPTION}, description = NODE_NAME_DESC) + private String nodeName; + } + + /** + * Returns node URL. + * + * @return Node URL + */ public String getNodeUrl() { - return nodeUrl != null ? nodeUrl.toString() : null; + if (options == null) { + return null; + } else { + if (options.nodeUrl != null) { + return options.nodeUrl.toString(); + } else { + return nodeNameRegistry.getNodeUrl(options.nodeName) + .orElseThrow(() -> new IgniteCliException("Node " + options.nodeName + "not found. Provide valid name or use URL")); Review Comment: `"not found` missing space. ########## modules/api/src/main/java/org/apache/ignite/network/NodeMetadata.java: ########## @@ -0,0 +1,72 @@ +/* + * 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.network; + +import java.io.Serializable; +import java.util.Objects; + +/** + * Contains metadata of the cluster node. + */ +public class NodeMetadata implements Serializable { + private static final long serialVersionUID = 3216463261002854096L; + + private String restHost; + private int restPort; + + public NodeMetadata() { + } + + public NodeMetadata(String restHost, int restPort) { + this.restHost = restHost; + this.restPort = restPort; + } + + public String getRestHost() { Review Comment: in general, we tend not to put 'get' and 'set' prefixes until it is required. ########## modules/cli/src/main/java/org/apache/ignite/internal/cli/NodeNameRegistry.java: ########## @@ -0,0 +1,113 @@ +/* + * 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; + +import jakarta.inject.Singleton; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; +import org.apache.ignite.internal.cli.call.cluster.topology.PhysicalTopologyCall; +import org.apache.ignite.internal.cli.core.call.UrlCallInput; +import org.apache.ignite.rest.client.model.NodeMetadata; + +/** + * Registry to get a node URL by a node name. + */ +@Singleton +public class NodeNameRegistry { + private final Map<String, String> nodeNameToNodeUrl = new ConcurrentHashMap<>(); + private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock(); + private volatile ScheduledExecutorService executor; + + /** + * Start pulling updates from a node. + * + * @param nodeUrl Node URL. + */ + public void startPullingUpdates(String nodeUrl) { + stopPullingUpdates(); + synchronized (this) { + if (executor == null) { + executor = Executors.newScheduledThreadPool(1); + executor.scheduleWithFixedDelay(() -> updateNodeNames(nodeUrl), 0, 5, TimeUnit.SECONDS); + } + } + } + + /** + * Stops pulling updates. + */ + public synchronized void stopPullingUpdates() { + if (executor != null) { + executor.shutdown(); + executor = null; + } + } + + /** + * Gets a node url by a provided node name. + */ + public Optional<String> getNodeUrl(String nodeName) { + readWriteLock.readLock().lock(); + try { + return Optional.ofNullable(nodeNameToNodeUrl.get(nodeName)); + } finally { + readWriteLock.readLock().unlock(); + } + } + + /** + * Gets all node names. + */ + public List<String> getAllNames() { + readWriteLock.readLock().lock(); + try { + return new ArrayList<>(nodeNameToNodeUrl.keySet()); + } finally { + readWriteLock.readLock().unlock(); + } + } + + private void updateNodeNames(String nodeUrl) { + readWriteLock.writeLock().lock(); Review Comment: I think you don't really need an RW lock here. By using this lock you want to do two-step operation safe: 1) clear map 2) put new entries That sound like it could be done with CAS operation, atomic reference. You just need to swat the old link with a new one. So, you don't need to use a lock anywhere. ########## modules/cli/src/main/java/org/apache/ignite/internal/cli/NodeNameRegistry.java: ########## @@ -0,0 +1,113 @@ +/* + * 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; + +import jakarta.inject.Singleton; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; +import org.apache.ignite.internal.cli.call.cluster.topology.PhysicalTopologyCall; +import org.apache.ignite.internal.cli.core.call.UrlCallInput; +import org.apache.ignite.rest.client.model.NodeMetadata; + +/** + * Registry to get a node URL by a node name. + */ +@Singleton +public class NodeNameRegistry { + private final Map<String, String> nodeNameToNodeUrl = new ConcurrentHashMap<>(); + private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock(); + private volatile ScheduledExecutorService executor; + + /** + * Start pulling updates from a node. + * + * @param nodeUrl Node URL. + */ + public void startPullingUpdates(String nodeUrl) { + stopPullingUpdates(); + synchronized (this) { + if (executor == null) { + executor = Executors.newScheduledThreadPool(1); + executor.scheduleWithFixedDelay(() -> updateNodeNames(nodeUrl), 0, 5, TimeUnit.SECONDS); + } + } + } + + /** + * Stops pulling updates. + */ + public synchronized void stopPullingUpdates() { + if (executor != null) { + executor.shutdown(); + executor = null; + } + } + + /** + * Gets a node url by a provided node name. + */ + public Optional<String> getNodeUrl(String nodeName) { + readWriteLock.readLock().lock(); + try { + return Optional.ofNullable(nodeNameToNodeUrl.get(nodeName)); + } finally { + readWriteLock.readLock().unlock(); + } + } + + /** + * Gets all node names. + */ + public List<String> getAllNames() { + readWriteLock.readLock().lock(); + try { + return new ArrayList<>(nodeNameToNodeUrl.keySet()); + } finally { + readWriteLock.readLock().unlock(); + } + } + + private void updateNodeNames(String nodeUrl) { + readWriteLock.writeLock().lock(); + try { + nodeNameToNodeUrl.clear(); + PhysicalTopologyCall topologyCall = new PhysicalTopologyCall(); + topologyCall.execute(new UrlCallInput(nodeUrl)).body() + .forEach(it -> { + nodeNameToNodeUrl.put(it.getName(), urlFromClusterNode(it.getMetadata())); + }); + } finally { + readWriteLock.writeLock().unlock(); + } + } + + private static String urlFromClusterNode(NodeMetadata metadata) { Review Comment: urlFromNodeMetadata ########## modules/cli/src/main/java/org/apache/ignite/internal/cli/commands/node/NodeUrl.java: ########## @@ -0,0 +1,33 @@ +/* + * 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.commands.node; + +import java.net.URL; + +/** Node URL. */ +public class NodeUrl { + private URL nodeUrl; + + public NodeUrl(URL nodeUrl) { + this.nodeUrl = nodeUrl; + } + + public String getNodeUrl() { Review Comment: `stringUrl()` ########## modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/NodeNameTest.java: ########## @@ -0,0 +1,97 @@ +/* + * 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.commands; + +import static org.junit.jupiter.api.Assertions.assertAll; + +import jakarta.inject.Inject; +import java.time.Duration; +import java.util.Optional; +import org.apache.ignite.internal.cli.Await; +import org.apache.ignite.internal.cli.NodeNameRegistry; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +/** Tests for ignite node commands with a provided node name. */ +public class NodeNameTest extends CliCommandTestNotInitializedIntegrationBase { + + @Inject + NodeNameRegistry nodeNameRegistry; + private String nodeName; + + @BeforeEach + void setUp() { + nodeNameRegistry.startPullingUpdates("http://localhost:10301"); + // wait to pulling node names + Await.await(() -> !nodeNameRegistry.getAllNames().isEmpty(), Duration.ofSeconds(5)); + Optional<String> nodeName = nodeNameRegistry.getAllNames().stream().findFirst(); + Assertions.assertTrue(nodeName.isPresent()); + this.nodeName = nodeName.get(); + Review Comment: Empty line ########## modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/completer/DynamicCompleterFactory.java: ########## @@ -89,4 +93,13 @@ public LazyDynamicCompleter clusterConfigCompleter(Set<String> activationPrefixe } }); } + + public LazyDynamicCompleter nodeNameCompleter(String... activationPrefixes) { + return nodeNameCompleter(Set.of(activationPrefixes)); + } + + public LazyDynamicCompleter nodeNameCompleter(Set<String> activationPrefixes) { + return new LazyDynamicCompleter(() -> new NodeNameDynamicCompleter(activationPrefixes, nodeNameRegistry.getAllNames())); Review Comment: You should not use LazyDynamicCompleter for node name completions. There is no reason for that. Also, LazyDynamicCompleter will initialize only once and **always** provide the same set of node names. ########## modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/NodeNameTest.java: ########## @@ -0,0 +1,97 @@ +/* + * 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.commands; + +import static org.junit.jupiter.api.Assertions.assertAll; + +import jakarta.inject.Inject; +import java.time.Duration; +import java.util.Optional; +import org.apache.ignite.internal.cli.Await; +import org.apache.ignite.internal.cli.NodeNameRegistry; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +/** Tests for ignite node commands with a provided node name. */ +public class NodeNameTest extends CliCommandTestNotInitializedIntegrationBase { + + @Inject + NodeNameRegistry nodeNameRegistry; + private String nodeName; + + @BeforeEach + void setUp() { + nodeNameRegistry.startPullingUpdates("http://localhost:10301"); + // wait to pulling node names + Await.await(() -> !nodeNameRegistry.getAllNames().isEmpty(), Duration.ofSeconds(5)); + Optional<String> nodeName = nodeNameRegistry.getAllNames().stream().findFirst(); + Assertions.assertTrue(nodeName.isPresent()); Review Comment: I think you can use hamcrest mather to check that the optional is not empty. ########## modules/cli/src/main/java/org/apache/ignite/internal/cli/core/converters/NodeNameOrUrlConverter.java: ########## @@ -0,0 +1,62 @@ +/* + * 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.converters; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.regex.Pattern; +import org.apache.ignite.internal.cli.NodeNameRegistry; +import org.apache.ignite.internal.cli.commands.node.NodeUrl; +import org.apache.ignite.internal.cli.core.exception.ParameterException; +import picocli.CommandLine; +import picocli.CommandLine.TypeConversionException; + +/** Converter for {@link NodeUrl}. */ +public class NodeNameOrUrlConverter implements CommandLine.ITypeConverter<NodeUrl> { + + private static final Pattern URL_PATTERN = Pattern.compile("^.*[/:].*"); + private final NodeNameRegistry nodeNameRegistry; Review Comment: eof -- 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]
