-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[HBASE-22591] : RecoverableZooKeeper improvement for getData, getChil… #310
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
Conversation
…dren, exists and removal of unused reference
|
🎊 +1 overall
This message was automatically generated. |
|
|
||
| private Stat getStatInstance(String path, Watcher watcher, Boolean watch) | ||
| throws InterruptedException, KeeperException { | ||
| try (TraceScope scope = TraceUtil.createTrace("RecoverableZookeeper.exists")) { |
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.
Why is there a need for the scope variable? It isn't used anywhere.
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.
It’s true that the scope variable isn’t used anywhere. However, that is how it is used with try-with-resources in most of the cases in this project to create htrace and then close it.
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.
|
|
||
| private List<String> getChildrenUtils(String path, Watcher watcher, Boolean watch) | ||
| throws InterruptedException, KeeperException { | ||
| try (TraceScope scope = TraceUtil.createTrace("RecoverableZookeeper.getChildren")) { |
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.
Ditto
|
|
||
| private byte[] getDataUtils(String path, Watcher watcher, Boolean watch, Stat stat) | ||
| throws InterruptedException, KeeperException { | ||
| try (TraceScope scope = TraceUtil.createTrace("RecoverableZookeeper.getData")) { |
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.
Ditto
| return getStatInstance(path, watcher, null); | ||
| } | ||
|
|
||
| private Stat getStatInstance(String path, Watcher watcher, Boolean watch) |
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.
maybe worth rename this method, overloading it as exists, for coherence?
| return getChildrenUtils(path, watcher, null); | ||
| } | ||
|
|
||
| private List<String> getChildrenUtils(String path, Watcher watcher, Boolean watch) |
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.
Similar to my previous comment, maybe simply overload getChildren?
| return getDataUtils(path, watcher, null, stat); | ||
| } | ||
|
|
||
| private byte[] getDataUtils(String path, Watcher watcher, Boolean watch, Stat stat) |
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.
Overload to getData?
|
Proposed changes look good. Overall, had suggested some minor neats, but it's more like a personal style, up to you @virajjasani . |
|
@wchevreuil Although it is personal style, it's definitely better one. Also, +1 to the removal of getSessionPasswd. Thanks for the suggestion. Incorporated in the latest commit |
|
🎊 +1 overall
This message was automatically generated. |
…dren, exists and removal of unused reference EnvironmentEdgeManager