pkuwm commented on a change in pull request #1066:
URL: https://github.com/apache/helix/pull/1066#discussion_r460221095
##########
File path:
helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixManager.java
##########
@@ -971,19 +972,24 @@ public void addPreConnectCallback(PreConnectCallback
callback) {
@Override
public boolean isLeader() {
+ return getSessionIdIfLead().isPresent();
+ }
+
+ @Override
+ public Optional<String> getSessionIdIfLead() {
Review comment:
Why we name it `getSessionIfLead()` is because following if should be an
adj., eg. `putIfAbsent()`, `computeIfPresent()` etc.. Lead is an adj. Leader is
not. So I think from usage, I prefer `getSessionIfLead()`. `isLeader()` is also
fine I think.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]