Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.Set;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionGroup;
import org.apache.commons.cli.Options;
import org.apache.rocketmq.remoting.RPCHook;
import org.apache.rocketmq.remoting.protocol.EpochEntry;
Expand All @@ -43,15 +44,13 @@ public String commandDesc() {

@Override
public Options buildCommandlineOptions(Options options) {
Option opt = new Option("c", "clusterName", true, "which cluster");
opt.setRequired(false);
options.addOption(opt);

opt = new Option("b", "brokerName", true, "which broker to fetch");
opt.setRequired(false);
options.addOption(opt);
OptionGroup group = new OptionGroup();
group.addOption(new Option("c", "clusterName", true, "which cluster"));
group.addOption(new Option("b", "brokerName", true, "which broker to fetch"));
group.setRequired(true);
options.addOptionGroup(group);

opt = new Option("i", "interval", true, "the interval(second) of get info");
Option opt = new Option("i", "interval", true, "the interval(second) of get info");
opt.setRequired(false);
options.addOption(opt);

Expand All @@ -68,7 +67,7 @@ public void execute(CommandLine commandLine, Options options,
if (commandLine.hasOption('i')) {
String interval = commandLine.getOptionValue('i');
int flushSecond = 3;
if (interval != null && !interval.trim().equals("")) {
if (interval != null && !interval.trim().isEmpty()) {
flushSecond = Integer.parseInt(interval);
}

Expand Down
Loading