Class ProjectCacheImpl

  • All Implemented Interfaces:
    ProjectCache

    public class ProjectCacheImpl
    extends Object
    implements ProjectCache
    Cache of project information, including access rights.
    • Method Detail

      • module

        public static com.google.inject.Module module()
      • getAllUsers

        public ProjectState getAllUsers()
        Specified by:
        getAllUsers in interface ProjectCache
        Returns:
        the project state of the project storing meta data for all users.
      • checkedGet

        public ProjectState checkedGet​(Project.NameKey projectName)
                                throws IOException
        Description copied from interface: ProjectCache
        Get the cached data for a project by its unique name.
        Specified by:
        checkedGet in interface ProjectCache
        Parameters:
        projectName - name of the project.
        Returns:
        the cached data; null if no such project exists or projectName is null.
        Throws:
        IOException - when there was an error.
      • checkedGet

        public ProjectState checkedGet​(Project.NameKey projectName,
                                       boolean strict)
                                throws Exception
        Description copied from interface: ProjectCache
        Get the cached data for a project by its unique name.
        Specified by:
        checkedGet in interface ProjectCache
        Parameters:
        projectName - name of the project.
        strict - true when any error generates an exception
        Returns:
        the cached data or null when strict = false
        Throws:
        Exception - in case of any error (strict = true) or only for I/O or other internal errors.
      • evict

        public void evict​(Project p)
        Description copied from interface: ProjectCache
        Invalidate the cached information about the given project, and triggers reindexing for it
        Specified by:
        evict in interface ProjectCache
        Parameters:
        p - project that is being evicted
      • evict

        public void evict​(Project.NameKey p)
        Description copied from interface: ProjectCache
        Invalidate the cached information about the given project, and triggers reindexing for it
        Specified by:
        evict in interface ProjectCache
        Parameters:
        p - the NameKey of the project that is being evicted
      • all

        public com.google.common.collect.ImmutableSortedSet<Project.NameKey> all()
        Specified by:
        all in interface ProjectCache
        Returns:
        sorted iteration of projects.
      • guessRelevantGroupUUIDs

        public Set<AccountGroup.UUID> guessRelevantGroupUUIDs()
        Specified by:
        guessRelevantGroupUUIDs in interface ProjectCache
        Returns:
        estimated set of relevant groups extracted from hot project access rules. If the cache is cold or too small for the entire project set of the server, this set may be incomplete.
      • byName

        public com.google.common.collect.ImmutableSortedSet<Project.NameKey> byName​(String pfx)
        Description copied from interface: ProjectCache
        Filter the set of registered project names by common prefix.
        Specified by:
        byName in interface ProjectCache
        Parameters:
        pfx - common prefix.
        Returns:
        sorted iteration of projects sharing the same prefix.
      • evictAllByName

        public void evictAllByName()
      • sizeAllByName

        public long sizeAllByName()