flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sahitya pavurala (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-3461) Remove duplicate condition check in ZooKeeperLeaderElectionService
Date Fri, 26 Feb 2016 04:50:18 GMT

    [ https://issues.apache.org/jira/browse/FLINK-3461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15168434#comment-15168434
] 

sahitya pavurala commented on FLINK-3461:
-----------------------------------------

I submitted a pull request for this, can you please review it. Thanks.

> 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)

Mime
View raw message