Package com.google.gerrit.server.git
Class SearchingChangeCacheImpl
- java.lang.Object
-
- com.google.gerrit.server.git.SearchingChangeCacheImpl
-
- All Implemented Interfaces:
GitReferenceUpdatedListener
,ChangesByProjectCache
public class SearchingChangeCacheImpl extends Object implements ChangesByProjectCache, GitReferenceUpdatedListener
Cache based on an index query of the most recent changes. The number of cached items depends on the index implementation and configuration.This cache is intended to be used when filtering references. By design it returns only a fraction of all changes. These are the changes that were modified last.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SearchingChangeCacheImpl.CachedChange
static class
SearchingChangeCacheImpl.SearchingChangeCacheImplModule
-
Nested classes/interfaces inherited from interface com.google.gerrit.server.git.ChangesByProjectCache
ChangesByProjectCache.Module, ChangesByProjectCache.UseIndex
-
Nested classes/interfaces inherited from interface com.google.gerrit.extensions.events.GitReferenceUpdatedListener
GitReferenceUpdatedListener.Event
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onGitReferenceUpdated(GitReferenceUpdatedListener.Event event)
Stream<ChangeData>
streamChangeDatas(Project.NameKey project, org.eclipse.jgit.lib.Repository unusedrepo)
Read changes for the project from the secondary index.
-
-
-
Method Detail
-
streamChangeDatas
public Stream<ChangeData> streamChangeDatas(Project.NameKey project, org.eclipse.jgit.lib.Repository unusedrepo)
Read changes for the project from the secondary index.Returned changes only include the
Change
object (with id, branch) and the reviewers. Additional stored fields are not loaded from the index.- Specified by:
streamChangeDatas
in interfaceChangesByProjectCache
- Parameters:
project
- project to read.unusedrepo
- repository for the project to read.- Returns:
- stream of known changes; empty if no changes.
-
onGitReferenceUpdated
public void onGitReferenceUpdated(GitReferenceUpdatedListener.Event event)
- Specified by:
onGitReferenceUpdated
in interfaceGitReferenceUpdatedListener
-
-