Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ROCKETMQ-278] Add clusterlist cmd by specified cluster #152

Closed
wants to merge 10 commits into from

Conversation

lindzh
Copy link
Contributor

@lindzh lindzh commented Aug 24, 2017

What is the purpose of the change

When using mqadmin command clusterlist, it always display all cluster, I want to display specified cluster. JIRA: https://issues.apache.org/jira/browse/ROCKETMQ-278.

Brief change log

  • add mqadmin clusterlist selected by cluster.

Verifying this change

  • This change is a trivial rework / code cleanup with unit test coverage.
  • execute mqadmin clusterlist -c {slecified cluster} to verify.

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ROCKETMQ-XXX] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand the pull request :
    • What is the purpose of the change
    • Brief change log
    • Verifying this change
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@lindzh lindzh changed the base branch from master to develop August 24, 2017 08:40
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 39.046% when pulling 2df4cfc on lindzh:add_clusterlist_cluster into ca14a2d on apache:develop.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 39.046% when pulling 2df4cfc on lindzh:add_clusterlist_cluster into ca14a2d on apache:develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 38.68% when pulling a674878 on lindzh:add_clusterlist_cluster into 4c5e58b on apache:develop.

@vsair
Copy link
Contributor

vsair commented Aug 29, 2017

nice!

@lindzh lindzh changed the title [ROCKETMQ-278]add clusterlist cmd by specified cluster [ROCKETMQ-278]Add clusterlist cmd by specified cluster Sep 7, 2017
@lindzh lindzh changed the title [ROCKETMQ-278]Add clusterlist cmd by specified cluster [ROCKETMQ-278] Add clusterlist cmd by specified cluster Sep 7, 2017
clusterInfoSerializeWrapper.setBrokerAddrTable(this.brokerAddrTable);
clusterInfoSerializeWrapper.setClusterAddrTable(this.clusterAddrTable);
return clusterInfoSerializeWrapper.encode();
public byte[] getAllClusterInfo(String cluster) {
Copy link
Contributor

@shroman shroman Sep 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You change the signature of the public method here.
How about having another method -- public byte[] getAllClusterInfo()? And you won't need calling getAllClusterInfo(null) then too ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree @shroman here

@dongeforever
Copy link
Member

LGTM @zhouxinyu @vongosling

@@ -1167,10 +1168,13 @@ public Properties getBrokerConfig(final String addr, final long timeoutMillis)
throw new MQBrokerException(response.getCode(), response.getRemark());
}

public ClusterInfo getBrokerClusterInfo(
public ClusterInfo getBrokerClusterInfo(String cluster,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how to insure the api compatibility

clusterInfoSerializeWrapper.setBrokerAddrTable(this.brokerAddrTable);
clusterInfoSerializeWrapper.setClusterAddrTable(this.clusterAddrTable);
return clusterInfoSerializeWrapper.encode();
public byte[] getAllClusterInfo(String cluster) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree @shroman here

@@ -65,7 +65,7 @@ public void execute(final CommandLine commandLine, final Options options,
try {
defaultMQAdminExt.start();
if (commandLine.hasOption('c')) {
ClusterInfo clusterInfo = defaultMQAdminExt.examineBrokerClusterInfo();
ClusterInfo clusterInfo = defaultMQAdminExt.examineBrokerClusterInfo(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null as parameter is not a good practice

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks,I will change it in the next commit.

@coveralls
Copy link

coveralls commented Dec 13, 2017

Coverage Status

Coverage increased (+0.06%) to 42.377% when pulling 0ddcf00 on lindzh:add_clusterlist_cluster into b054a9d on apache:develop.

@vongosling
Copy link
Member

@lindzh would you please resolve the conflicts, I will merge it.

@lindzh
Copy link
Contributor Author

lindzh commented Jul 16, 2018

@vongosling conflicts has been resolved.

@vongosling
Copy link
Member

Too much merge request commits, could you mind using git pull --rebase to polish your pr ?

@vongosling
Copy link
Member

@lindzh Thanks, I will pick up the real codes to merge into the develop branch. Expect you to keep your eyes on the RocketMQ community :-)

@vongosling vongosling closed this Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants