pkuwm commented on a change in pull request #1066:
URL: https://github.com/apache/helix/pull/1066#discussion_r437624701
##########
File path: helix-core/src/main/java/org/apache/helix/HelixManager.java
##########
@@ -425,6 +426,20 @@ void
addExternalViewChangeListener(org.apache.helix.ExternalViewChangeListener l
*/
boolean isLeader();
+ /**
+ * Checks whether the cluster manager is leader and sets its ZK session in
param
+ * {@link InstanceLeaderSession} if and only if it is leader.
+ *
+ * @param instanceLeaderSession To include ZK session ID of the cluster
manager in return
+ *
+ * @return true if the instance is a leader of the cluster and Zk session of
the cluster
+ * manager is return in param {@link InstanceLeaderSession}
+ */
+ default boolean isInstanceLeader(InstanceLeaderSession
instanceLeaderSession) {
+ throw new UnsupportedOperationException(
+ "Checking leader and returning session is not supported.");
+ }
Review comment:
I was making it the same name `isLeader(session)`. @lei-xia reminded
that helix manager does not have a controller concept so no leader/follower
concept. I thought the instance itself managed by the helix manager is a
controller. So I name it `isInstanceLeader(session)`. We could discuss and have
an agreement. @jiajunwang Could you also take a look? Thanks.
----------------------------------------------------------------
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]