You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/02/24 03:15:18 UTC
[jira] [Commented] (FLINK-3461) Remove duplicate condition check in
ZooKeeperLeaderElectionService
[ https://issues.apache.org/jira/browse/FLINK-3461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15160062#comment-15160062 ]
ASF GitHub Bot commented on FLINK-3461:
---------------------------------------
Github user sahitya-pavurala commented on the pull request:
https://github.com/apache/flink/pull/1700#issuecomment-188014656
I just found a Jira for this [https://issues.apache.org/jira/browse/FLINK-3461] . Please review.
> Remove duplicate condition check in ZooKeeperLeaderElectionService
> ------------------------------------------------------------------
>
> Key: FLINK-3461
> URL: https://issues.apache.org/jira/browse/FLINK-3461
> Project: Flink
> Issue Type: Improvement
> Reporter: Ufuk Celebi
> Priority: Trivial
>
> In {{ZooKeeperLeaderElectionService}}:
> {code}
> @Override
> public boolean hasLeadership() {
> if(leaderLatch.getState().equals(LeaderLatch.State.STARTED)) {
> return leaderLatch.hasLeadership();
> } else {
> return false;
> }
> }
> {code}
> Looking into the leader {{leaderLatch.hasLeadership()}}, the state gets checked already/again.
> {code}
> return (state.get() == State.STARTED) && hasLeadership.get();
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)