Package com.google.gerrit.server.project
Class ProjectCacheImpl
java.lang.Object
com.google.gerrit.server.project.ProjectCacheImpl
- All Implemented Interfaces:
- ProjectCache
Cache of project information, including access rights.
 
The data of a project is the project's project.config in refs/meta/config parsed out as an immutable value. It's keyed purely by the refs/meta/config SHA-1. We also cache the same value keyed by name. The latter mapping can become outdated, so data must be evicted explicitly.
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptioncom.google.common.collect.ImmutableSortedSet<Project.NameKey>all()Returns sorted iteration of projects.static byte[]allProjectsFileProjectConfigHash(Optional<org.eclipse.jgit.lib.StoredConfig> allProjectsConfig) Returns aMurMur128hash of the contents ofetc/All-Projects-project.config.com.google.common.collect.ImmutableSortedSet<Project.NameKey>Filter the set of registered project names by common prefix.voidInvalidate the cached information about the given project.voidvoidInvalidate the cached information about the given project, and triggers reindexing for itvoidInvalidate the cached information about the given project, and triggers reindexing for itget(Project.NameKey projectName) Get the cached data for a project by its unique name.Returns the parent state for all projects on this server.Returns the project state of the project storing meta data for all users.Returns estimated set of relevant groups extracted from hot project access rules.static com.google.inject.Modulemodule()voidonCreateProject(Project.NameKey newProjectName) Notify the cache that a new project was constructed.voidRefreshes project list cachevoidRemove information about the given project from the cache.voidremove(Project.NameKey name) Remove information about the given project from the cache.long
- 
Field Details- 
CACHE_NAME- See Also:
 
- 
PERSISTED_CACHE_NAME- See Also:
 
- 
CACHE_LIST- See Also:
 
 
- 
- 
Method Details- 
modulepublic static com.google.inject.Module module()
- 
getAllProjectsDescription copied from interface:ProjectCacheReturns the parent state for all projects on this server.- Specified by:
- getAllProjectsin interface- ProjectCache
 
- 
getAllUsersDescription copied from interface:ProjectCacheReturns the project state of the project storing meta data for all users.- Specified by:
- getAllUsersin interface- ProjectCache
 
- 
getDescription copied from interface:ProjectCacheGet the cached data for a project by its unique name.- Specified by:
- getin interface- ProjectCache
- Parameters:
- projectName- name of the project.
- Returns:
- an Optionalwrapping the cached data;absentif no such project exists or the projectName is null
 
- 
evictDescription copied from interface:ProjectCacheInvalidate the cached information about the given project.- Specified by:
- evictin interface- ProjectCache
- Parameters:
- p- the NameKey of the project that is being evicted
 
- 
evictAndReindexDescription copied from interface:ProjectCacheInvalidate the cached information about the given project, and triggers reindexing for it- Specified by:
- evictAndReindexin interface- ProjectCache
- Parameters:
- p- project that is being evicted
 
- 
evictAndReindexDescription copied from interface:ProjectCacheInvalidate the cached information about the given project, and triggers reindexing for it- Specified by:
- evictAndReindexin interface- ProjectCache
- Parameters:
- p- the NameKey of the project that is being evicted
 
- 
removeDescription copied from interface:ProjectCacheRemove information about the given project from the cache. It will no longer be returned fromProjectCache.all().- Specified by:
- removein interface- ProjectCache
 
- 
removeDescription copied from interface:ProjectCacheRemove information about the given project from the cache. It will no longer be returned fromProjectCache.all().- Specified by:
- removein interface- ProjectCache
 
- 
onCreateProjectDescription copied from interface:ProjectCacheNotify the cache that a new project was constructed.- Specified by:
- onCreateProjectin interface- ProjectCache
- Throws:
- IOException
 
- 
allDescription copied from interface:ProjectCacheReturns sorted iteration of projects.- Specified by:
- allin interface- ProjectCache
 
- 
refreshProjectListpublic void refreshProjectList()Description copied from interface:ProjectCacheRefreshes project list cache- Specified by:
- refreshProjectListin interface- ProjectCache
 
- 
guessRelevantGroupUUIDsDescription copied from interface:ProjectCacheReturns 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.- Specified by:
- guessRelevantGroupUUIDsin interface- ProjectCache
 
- 
byNameDescription copied from interface:ProjectCacheFilter the set of registered project names by common prefix.- Specified by:
- byNamein interface- ProjectCache
- Parameters:
- pfx- common prefix.
- Returns:
- sorted iteration of projects sharing the same prefix.
 
- 
allProjectsFileProjectConfigHashpublic static byte[] allProjectsFileProjectConfigHash(Optional<org.eclipse.jgit.lib.StoredConfig> allProjectsConfig) Returns aMurMur128hash of the contents ofetc/All-Projects-project.config.
- 
evictAllByNamepublic void evictAllByName()
- 
sizeAllByNamepublic long sizeAllByName()
 
-