-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-25553 It is better for ReplicationTracker.getListOfRegionServer… #2928
Conversation
🎊 +1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Have just a small suggestion, fine to go without it, up to you @ddupg .
@@ -168,7 +169,7 @@ private boolean refreshOtherRegionServersList(boolean watch) { | |||
} else { | |||
synchronized (otherRegionServers) { | |||
otherRegionServers.clear(); | |||
otherRegionServers.addAll(newRsList); | |||
newRsList.stream().map(ServerName::parseServerName).forEach(otherRegionServers::add); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Maybe worth do this conversion inside getRegisteredRegionServers
method, instead, as it's the first point of entry from ZK where data comes as Sting still? Just in case we may find useful use getRegisteredRegionServers
method elsewhere, then it would already be returning a list of ServerName
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank @wchevreuil for reviwing, your opinion is indeed better, I have revised it.
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
…s to return ServerName instead of String
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one comment, looks good overall
return result == null ? null : | ||
result.stream().map(ServerName::parseServerName).collect(Collectors.toList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's take this opportunity to never return null here. If result is null, let's return emptyList()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank @virajjasani for reviwing.
For method refreshOtherRegionServersList
that calls getRegisteredRegionServers
, it's different that getting null and empty list. It returns true or false depending on whether the result is null. Getting null
means that an exception has occurred or the node does not exist in ZK.
So it is not very recommended to make this change, at least in this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I wish we could fix that boolean condition too, but I agree that it doesn't need to be part of this PR. Maybe later sometime.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
…s to return ServerName instead of String (#2928) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
…s to return ServerName instead of String (#2928) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
…s to return ServerName instead of String (#2928) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
…s to return ServerName instead of String (#2928) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
…s to return ServerName instead of String (#2928) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
…s to return ServerName instead of String (apache#2928) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
…s to return ServerName instead of String (apache#2928) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org> (cherry picked from commit d81ae67) Change-Id: I9b713ba64dd369fb1aa82800b9d9e5f389d5fd45
…onServers to return ServerName instead of String (apache#2928)" This reverts commit d81ae67 (cherry picked from commit c4b194a) Change-Id: Ib79a8529a91b02359d58bee344abc987d8ea5603
…s to return ServerName instead of String (apache#2928) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org> (cherry picked from commit b169808) Change-Id: Id290ecf8cdfb8dba03867780c54e2094766806d7
…s to return ServerName instead of String