public void stop() throws Exception {
		LOG.info("Stop job leader service.");

		if (JobLeaderService.State.STARTED == state) {

			for (Tuple2<LeaderRetrievalService, JobLeaderService.JobManagerLeaderListener> leaderRetrievalServiceEntry: jobLeaderServices.values()) {
				LeaderRetrievalService leaderRetrievalService = leaderRetrievalServiceEntry.f0;
				JobLeaderService.JobManagerLeaderListener jobManagerLeaderListener = leaderRetrievalServiceEntry.f1;

				jobManagerLeaderListener.stop();
				leaderRetrievalService.stop();
			}

			jobLeaderServices.clear();
		}

		state = JobLeaderService.State.STOPPED;
	}
public void stop ( ) throws Exception { LOG . info ( "Stop job leader service." ) ; if ( JobLeaderService . State . STARTED == state ) { for ( Tuple2 < LeaderRetrievalService , JobLeaderService . JobManagerLeaderListener > leaderRetrievalServiceEntry : jobLeaderServices . values ( ) ) { LeaderRetrievalService leaderRetrievalService = leaderRetrievalServiceEntry . f0 ; JobLeaderService . JobManagerLeaderListener jobManagerLeaderListener = leaderRetrievalServiceEntry . f1 ; jobManagerLeaderListener . stop ( ) ; leaderRetrievalService . stop ( ) ; } jobLeaderServices . clear ( ) ; } state = JobLeaderService . State . STOPPED ; }
Stop the job leader services. This implies stopping all leader retrieval services for the
different jobs and their leader retrieval listeners.

@throws Exception if an error occurs while stopping the service