Package com.google.gerrit.server.notedb
Class ChangeNotes.Factory
- java.lang.Object
-
- com.google.gerrit.server.notedb.ChangeNotes.Factory
-
- Enclosing class:
- ChangeNotes
public static class ChangeNotes.Factory extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ChangeNotes.Factory.ChangeNotesResult
Result ofscan(Repository,Project.NameKey)
.
-
Constructor Summary
Constructors Constructor Description Factory(AbstractChangeNotes.Args args, com.google.inject.Provider<InternalChangeQuery> queryProvider, ProjectCache projectCache)
-
Method Summary
-
-
-
Constructor Detail
-
Factory
@Inject public Factory(AbstractChangeNotes.Args args, com.google.inject.Provider<InternalChangeQuery> queryProvider, ProjectCache projectCache)
-
-
Method Detail
-
createChecked
public ChangeNotes createChecked(Change c)
-
createChecked
public ChangeNotes createChecked(Project.NameKey project, Change.Id changeId)
-
newChange
public static Change newChange(Project.NameKey project, Change.Id changeId)
-
create
public ChangeNotes create(Project.NameKey project, Change.Id changeId)
-
createFromIndexedChange
public ChangeNotes createFromIndexedChange(Change change)
Create change notes for a change that was loaded from index. This method should only be used when database access is harmful and potentially stale data from the index is acceptable.- Parameters:
change
- change loaded from secondary index- Returns:
- change notes
-
createForBatchUpdate
public ChangeNotes createForBatchUpdate(Change change, boolean shouldExist)
-
create
public ChangeNotes create(Change change, RefCache refs)
-
createCheckedUsingIndexLookup
public ChangeNotes createCheckedUsingIndexLookup(Change.Id changeId)
Create change notes based on aChange.Id
. This requires using the Change index and should only be used whenProject.NameKey
and the numeric change ID are not available.
-
createUsingIndexLookup
public List<ChangeNotes> createUsingIndexLookup(Collection<Change.Id> changeIds)
Create change notes based on a list ofChange.Id
s. This requires using the Change index and should only be used whenProject.NameKey
and the numeric change ID are not available.
-
create
public List<ChangeNotes> create(Project.NameKey project, Collection<Change.Id> changeIds, Predicate<ChangeNotes> predicate)
-
create
public com.google.common.collect.ListMultimap<Project.NameKey,ChangeNotes> create(Predicate<ChangeNotes> predicate) throws IOException
- Throws:
IOException
-
scan
public Stream<ChangeNotes.Factory.ChangeNotesResult> scan(org.eclipse.jgit.lib.Repository repo, Project.NameKey project) throws IOException
- Throws:
IOException
-
scan
public Stream<ChangeNotes.Factory.ChangeNotesResult> scan(org.eclipse.jgit.lib.Repository repo, Project.NameKey project, Predicate<Change.Id> changeIdPredicate) throws IOException
- Throws:
IOException
-
-