Class KetchLeaderCache


  • public class KetchLeaderCache
    extends Object
    A cache of live leader instances, keyed by repository.

    Ketch only assigns a leader to a repository when needed. If get(Repository) is called for a repository that does not have a leader, the leader is created and added to the cache.

    • Constructor Detail

      • KetchLeaderCache

        public KetchLeaderCache​(KetchSystem system)
        Initialize a new leader cache.
        Parameters:
        system - system configuration for the leaders
    • Method Detail

      • get

        public KetchLeader get​(Repository repo)
                        throws URISyntaxException
        Lookup the leader instance for a given repository.
        Parameters:
        repo - repository to get the leader for.
        Returns:
        the leader instance for the repository.
        Throws:
        URISyntaxException - remote configuration contains an invalid URL.