Mmuzaf commented on code in PR #2497: URL: https://github.com/apache/cassandra/pull/2497#discussion_r2232090564
########## src/java/org/apache/cassandra/tools/nodetool/JmxConnect.java: ########## @@ -0,0 +1,239 @@ +/* + * 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.cassandra.tools.nodetool; + +import java.io.Console; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.List; +import java.util.Scanner; +import javax.inject.Inject; + +import com.google.common.base.Throwables; + +import org.apache.cassandra.io.util.File; +import org.apache.cassandra.tools.INodeProbeFactory; +import org.apache.cassandra.tools.NodeProbe; +import picocli.CommandLine; +import picocli.CommandLine.Command; +import picocli.CommandLine.ExecutionException; +import picocli.CommandLine.IExecutionStrategy; +import picocli.CommandLine.InitializationException; +import picocli.CommandLine.Model.CommandSpec; +import picocli.CommandLine.Option; +import picocli.CommandLine.ParameterException; +import picocli.CommandLine.ParseResult; +import picocli.CommandLine.RunLast; +import picocli.CommandLine.Spec; + +import static java.lang.Integer.parseInt; +import static org.apache.commons.lang3.StringUtils.EMPTY; +import static org.apache.commons.lang3.StringUtils.isEmpty; +import static org.apache.commons.lang3.StringUtils.isNotEmpty; + +/** + * Command options for NodeTool commands that are executed via JMX. + */ +@Command(name = "connect", description = "Connect to a Cassandra node via JMX") +public class JmxConnect extends AbstractCommand implements AutoCloseable +{ + public static final String MIXIN_KEY = "jmx"; + + /** The command specification, used to access command-specific properties. */ + @Spec + protected CommandSpec spec; // injected by picocli + + @Option(names = { "-h", "--host" }, description = "Node hostname or ip address", arity = "0..1") + private String host = "127.0.0.1"; + + @Option(names = { "-p", "--port" }, description = "Remote jmx agent port number", arity = "0..1") + private String port = "7199"; Review Comment: Fixed. ########## src/java/org/apache/cassandra/tools/StandaloneJournalUtil.java: ########## @@ -44,17 +50,12 @@ import org.apache.cassandra.service.accord.serializers.Version; import org.apache.cassandra.tcm.ClusterMetadataService; -import java.io.IOException; -import java.nio.file.FileSystems; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.PathMatcher; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.atomic.AtomicInteger; +import accord.local.RedundantBefore; +import accord.primitives.Timestamp; +import accord.primitives.TxnId; Review Comment: Fixed. -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org