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

HDDS-3273. getConf does not return all OM addresses. #727

Merged
merged 3 commits into from
Mar 28, 2020

Conversation

swagle
Copy link
Contributor

@swagle swagle commented Mar 27, 2020

What changes were proposed in this pull request?

Added a new utility method to return a list of addresses keyed by serviceId.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-3273

How was this patch tested?

Added a unit test and verified via docker:

bash-4.2$ /opt/hadoop/bin/ozone getconf -ozonemanagers
{omservice=[om1/172.22.0.6:9862, om2/172.22.0.4:9862, om3/172.22.0.2:9862]}

bash-4.2$ /opt/hadoop/bin/ozone getconf -ozonemanagers
om

@swagle
Copy link
Contributor Author

swagle commented Mar 27, 2020

cc: @xiaoyuyao / @bharatviswa504 for review.

bharatviswa504
bharatviswa504 previously approved these changes Mar 27, 2020
Copy link
Contributor

@bharatviswa504 bharatviswa504 left a comment

Choose a reason for hiding this comment

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

One minor comment overall LGTM.

for (String nodeId : getOMNodeIds(conf, serviceId)) {
String rpcAddr = getOmRpcAddress(conf,
addKeySuffixes(OZONE_OM_ADDRESS_KEY, serviceId, nodeId));
if (rpcAddr != null) {
Copy link
Contributor

@bharatviswa504 bharatviswa504 Mar 27, 2020

Choose a reason for hiding this comment

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

One minor comment. when for one of nodeId address is undefined, do we want to print "unknown address" instead of silently ignoring?

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, Bharat for review.

Actually I modeled the method based on getOmAddress() and return InetSocketAddress so cannot put random string in the map, I added a log message instead.

@bharatviswa504 bharatviswa504 self-requested a review March 27, 2020 05:15
@bharatviswa504 bharatviswa504 dismissed their stale review March 27, 2020 05:19

One minor comment

Copy link
Contributor

@bharatviswa504 bharatviswa504 left a comment

Choose a reason for hiding this comment

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

+1 LGTM.

@bharatviswa504 bharatviswa504 merged commit 099ab62 into apache:master Mar 28, 2020
@bharatviswa504
Copy link
Contributor

Thank You @swagle for the contribution.

isahekmat pushed a commit to isahekmat/hadoop-ozone that referenced this pull request Mar 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants