@Override public LeaderConnectionInfo getClusterConnectionInfo() throws LeaderRetrievalException { return LeaderRetrievalUtils.retrieveLeaderConnectionInfo( highAvailabilityServices.getDispatcherLeaderRetriever(), timeout); }
@Override public LeaderConnectionInfo getClusterConnectionInfo() throws LeaderRetrievalException { return LeaderRetrievalUtils.retrieveLeaderConnectionInfo( highAvailabilityServices.getDispatcherLeaderRetriever(), timeout); }
/** * Gets the current cluster connection info (may change in case of a HA setup). * * @return The the connection info to the leader component of the cluster * @throws LeaderRetrievalException if the leader could not be retrieved */ public LeaderConnectionInfo getClusterConnectionInfo() throws LeaderRetrievalException { return LeaderRetrievalUtils.retrieveLeaderConnectionInfo( highAvailabilityServices.getJobManagerLeaderRetriever(HighAvailabilityServices.DEFAULT_JOB_ID), timeout); }
/** * Helper method to wait until the {@link Dispatcher} has set its fencing token. * * @param rpcService to use to connect to the dispatcher * @param haServices high availability services to connect to the dispatcher * @return {@link DispatcherGateway} * @throws Exception if something goes wrong */ static DispatcherGateway retrieveDispatcherGateway(RpcService rpcService, HighAvailabilityServices haServices) throws Exception { final LeaderConnectionInfo leaderConnectionInfo = LeaderRetrievalUtils.retrieveLeaderConnectionInfo(haServices.getDispatcherLeaderRetriever(), Time.seconds(10L)); return rpcService.connect( leaderConnectionInfo.getAddress(), DispatcherId.fromUuid(leaderConnectionInfo.getLeaderSessionID()), DispatcherGateway.class).get(); }
/** * Gets the current cluster connection info (may change in case of a HA setup). * * @return The the connection info to the leader component of the cluster * @throws LeaderRetrievalException if the leader could not be retrieved */ public LeaderConnectionInfo getClusterConnectionInfo() throws LeaderRetrievalException { return LeaderRetrievalUtils.retrieveLeaderConnectionInfo( highAvailabilityServices.getJobManagerLeaderRetriever(HighAvailabilityServices.DEFAULT_JOB_ID), timeout); }
@Override public LeaderConnectionInfo getClusterConnectionInfo() throws LeaderRetrievalException { return LeaderRetrievalUtils.retrieveLeaderConnectionInfo( highAvailabilityServices.getDispatcherLeaderRetriever(), timeout); }
@Override public LeaderConnectionInfo getClusterConnectionInfo() throws LeaderRetrievalException { return LeaderRetrievalUtils.retrieveLeaderConnectionInfo( highAvailabilityServices.getDispatcherLeaderRetriever(), timeout); }
@Override public LeaderConnectionInfo getClusterConnectionInfo() throws LeaderRetrievalException { return LeaderRetrievalUtils.retrieveLeaderConnectionInfo( highAvailabilityServices.getDispatcherLeaderRetriever(), timeout); }
/** * Gets the current cluster connection info (may change in case of a HA setup). * * @return The the connection info to the leader component of the cluster * @throws LeaderRetrievalException if the leader could not be retrieved */ public LeaderConnectionInfo getClusterConnectionInfo() throws LeaderRetrievalException { return LeaderRetrievalUtils.retrieveLeaderConnectionInfo( highAvailabilityServices.getJobManagerLeaderRetriever(HighAvailabilityServices.DEFAULT_JOB_ID), timeout); }
@Override public LeaderConnectionInfo getClusterConnectionInfo() throws LeaderRetrievalException { return LeaderRetrievalUtils.retrieveLeaderConnectionInfo( highAvailabilityServices.getDispatcherLeaderRetriever(), timeout); }
/** * Retrieves the current leader session id of the component identified by the given leader * retrieval service. * * @param leaderRetrievalService Leader retrieval service to be used for the leader retrieval * @param timeout Timeout for the leader retrieval * @return The leader session id of the retrieved leader * @throws LeaderRetrievalException if the leader retrieval operation fails (including a timeout) */ public static UUID retrieveLeaderSessionId( LeaderRetrievalService leaderRetrievalService, FiniteDuration timeout) throws LeaderRetrievalException { return retrieveLeaderConnectionInfo(leaderRetrievalService, timeout).getLeaderSessionID(); }
/** * Retrieves the current leader session id of the component identified by the given leader * retrieval service. * * @param leaderRetrievalService Leader retrieval service to be used for the leader retrieval * @param timeout Timeout for the leader retrieval * @return The leader session id of the retrieved leader * @throws LeaderRetrievalException if the leader retrieval operation fails (including a timeout) */ public static UUID retrieveLeaderSessionId( LeaderRetrievalService leaderRetrievalService, FiniteDuration timeout) throws LeaderRetrievalException { return retrieveLeaderConnectionInfo(leaderRetrievalService, timeout).getLeaderSessionID(); }
/** * Retrieves the current leader session id of the component identified by the given leader * retrieval service. * * @param leaderRetrievalService Leader retrieval service to be used for the leader retrieval * @param timeout Timeout for the leader retrieval * @return The leader session id of the retrieved leader * @throws LeaderRetrievalException if the leader retrieval operation fails (including a timeout) */ public static UUID retrieveLeaderSessionId( LeaderRetrievalService leaderRetrievalService, FiniteDuration timeout) throws LeaderRetrievalException { return retrieveLeaderConnectionInfo(leaderRetrievalService, timeout).getLeaderSessionID(); }
/** * Retrieves the current leader session id of the component identified by the given leader * retrieval service. * * @param leaderRetrievalService Leader retrieval service to be used for the leader retrieval * @param timeout Timeout for the leader retrieval * @return The leader session id of the retrieved leader * @throws LeaderRetrievalException if the leader retrieval operation fails (including a timeout) */ public static UUID retrieveLeaderSessionId( LeaderRetrievalService leaderRetrievalService, FiniteDuration timeout) throws LeaderRetrievalException { return retrieveLeaderConnectionInfo(leaderRetrievalService, timeout).getLeaderSessionID(); }
/** * Retrieves the leader akka url and the current leader session ID. The values are stored in a * {@link LeaderConnectionInfo} instance. * * @param leaderRetrievalService Leader retrieval service to retrieve the leader connection * information * @param timeout Timeout when to give up looking for the leader * @return LeaderConnectionInfo containing the leader's akka URL and the current leader session * ID * @throws LeaderRetrievalException */ public static LeaderConnectionInfo retrieveLeaderConnectionInfo( LeaderRetrievalService leaderRetrievalService, Time timeout) throws LeaderRetrievalException { return retrieveLeaderConnectionInfo(leaderRetrievalService, FutureUtils.toFiniteDuration(timeout)); }
/** * Retrieves the leader akka url and the current leader session ID. The values are stored in a * {@link LeaderConnectionInfo} instance. * * @param leaderRetrievalService Leader retrieval service to retrieve the leader connection * information * @param timeout Timeout when to give up looking for the leader * @return LeaderConnectionInfo containing the leader's akka URL and the current leader session * ID * @throws LeaderRetrievalException */ public static LeaderConnectionInfo retrieveLeaderConnectionInfo( LeaderRetrievalService leaderRetrievalService, Time timeout) throws LeaderRetrievalException { return retrieveLeaderConnectionInfo(leaderRetrievalService, FutureUtils.toFiniteDuration(timeout)); }
/** * Gets the current JobManager address (may change in case of a HA setup). * @return The address (host and port) of the leading JobManager */ public InetSocketAddress getJobManagerAddress() { try { LeaderConnectionInfo leaderConnectionInfo = LeaderRetrievalUtils.retrieveLeaderConnectionInfo( highAvailabilityServices.getJobManagerLeaderRetriever(HighAvailabilityServices.DEFAULT_JOB_ID), timeout); return AkkaUtils.getInetSockeAddressFromAkkaURL(leaderConnectionInfo.getAddress()); } catch (Exception e) { throw new RuntimeException("Failed to retrieve JobManager address", e); } }