Class LeaderRetriever

    • Field Detail

      • log

        protected final org.slf4j.Logger log
    • Constructor Detail

      • LeaderRetriever

        public LeaderRetriever()
    • Method Detail

      • getLeaderNow

        public Optional<org.apache.flink.api.java.tuple.Tuple2<String,​UUID>> getLeaderNow()
                                                                                         throws Exception
        Returns the current leader information if available. Otherwise it returns an empty optional.
        Returns:
        The current leader information if available. Otherwise it returns an empty optional.
        Throws:
        Exception - if the leader future has been completed with an exception
      • getLeaderFuture

        public CompletableFuture<org.apache.flink.api.java.tuple.Tuple2<String,​UUID>> getLeaderFuture()
        Returns the current JobManagerGateway future.
      • notifyLeaderAddress

        public void notifyLeaderAddress​(String leaderAddress,
                                        UUID leaderSessionID)
        Description copied from interface: LeaderRetrievalListener
        This method is called by the LeaderRetrievalService when a new leader is elected.

        If both arguments are null then it signals that leadership was revoked without a new leader having been elected.

        Specified by:
        notifyLeaderAddress in interface LeaderRetrievalListener
        Parameters:
        leaderAddress - The address of the new leader
        leaderSessionID - The new leader session ID
      • notifyNewLeaderAddress

        protected void notifyNewLeaderAddress​(CompletableFuture<org.apache.flink.api.java.tuple.Tuple2<String,​UUID>> newLeaderAddressFuture)