Package com.google.gerrit.server.notedb
Class ChangeNotes.Factory
java.lang.Object
com.google.gerrit.server.notedb.ChangeNotes.Factory
- Enclosing class:
- ChangeNotes
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionFactory
(AbstractChangeNotes.Args args, com.google.inject.Provider<InternalChangeQuery> queryProvider, ProjectCache projectCache) -
Method Summary
Modifier and TypeMethodDescriptioncreate
(Project.NameKey project, Change.Id changeId) create
(Project.NameKey project, Change.Id changeId, org.eclipse.jgit.lib.ObjectId metaRevId) create
(Project.NameKey project, Collection<Change.Id> changeIds, Predicate<ChangeNotes> predicate) com.google.common.collect.ListMultimap<Project.NameKey,
ChangeNotes> create
(Predicate<ChangeNotes> predicate) create
(org.eclipse.jgit.lib.Repository repository, Project.NameKey project, Change.Id changeId) create
(org.eclipse.jgit.lib.Repository repo, Project.NameKey project, Collection<Change.Id> changeIds, Predicate<ChangeNotes> predicate) createChecked
(Project.NameKey project, Change.Id changeId) createChecked
(Project.NameKey project, Change.Id changeId, org.eclipse.jgit.lib.ObjectId metaRevId) createChecked
(org.eclipse.jgit.lib.Repository repo, Project.NameKey project, Change.Id changeId, org.eclipse.jgit.lib.ObjectId metaRevId) Load the change-notes associated to a project/change-id using an existing open repositorycreateCheckedUsingIndexLookup
(Change.Id changeId) Create change notes based on aChange.Id
.createForBatchUpdate
(Change change, boolean shouldExist) createFromIndexedChange
(Change change) Create change notes for a change that was loaded from index.createUsingIndexLookup
(Collection<Change.Id> changeIds) Create change notes based on a list ofChange.Id
s.static Change
newChange
(Project.NameKey project, Change.Id changeId) scan
(com.google.common.collect.ImmutableMap<Change.Id, org.eclipse.jgit.lib.ObjectId> metaIdByChange, Project.NameKey project, Predicate<Change.Id> changeIdPredicate) scan
(org.eclipse.jgit.lib.Repository repo, Project.NameKey project) scan
(org.eclipse.jgit.lib.Repository repo, Project.NameKey project, Predicate<Change.Id> changeIdPredicate) static com.google.common.collect.ImmutableMap<Change.Id,
org.eclipse.jgit.lib.ObjectId> scanChangeIds
(org.eclipse.jgit.lib.Repository repo)
-
Constructor Details
-
Factory
@Inject public Factory(AbstractChangeNotes.Args args, com.google.inject.Provider<InternalChangeQuery> queryProvider, ProjectCache projectCache)
-
-
Method Details
-
scanChangeIds
public static com.google.common.collect.ImmutableMap<Change.Id,org.eclipse.jgit.lib.ObjectId> scanChangeIds(org.eclipse.jgit.lib.Repository repo) throws IOException - Throws:
IOException
-
createChecked
-
createChecked
public ChangeNotes createChecked(org.eclipse.jgit.lib.Repository repo, Project.NameKey project, Change.Id changeId, org.eclipse.jgit.lib.ObjectId metaRevId) Load the change-notes associated to a project/change-id using an existing open repository- Parameters:
repo
- existing open repositoryproject
- project associated with the repositorychangeId
- change-id associated with the change-notes to loadmetaRevId
- version of the change-id to load, null for loading the latest- Returns:
- change-notes object for the change
-
createChecked
public ChangeNotes createChecked(Project.NameKey project, Change.Id changeId, org.eclipse.jgit.lib.ObjectId metaRevId) -
createChecked
-
newChange
-
create
-
create
public ChangeNotes create(Project.NameKey project, Change.Id changeId, org.eclipse.jgit.lib.ObjectId metaRevId) -
create
public ChangeNotes create(org.eclipse.jgit.lib.Repository repository, Project.NameKey project, Change.Id changeId) -
createFromIndexedChange
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
-
create
-
createCheckedUsingIndexLookup
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
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(org.eclipse.jgit.lib.Repository repo, Project.NameKey project, Collection<Change.Id> changeIds, Predicate<ChangeNotes> predicate) -
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
-
scan
public Stream<ChangeNotes.Factory.ChangeNotesResult> scan(com.google.common.collect.ImmutableMap<Change.Id, org.eclipse.jgit.lib.ObjectId> metaIdByChange, Project.NameKey project, Predicate<Change.Id> changeIdPredicate)
-