Package com.google.gerrit.server.submit
Class SubscriptionGraph
java.lang.Object
com.google.gerrit.server.submit.SubscriptionGraph
A container which stores subscription relationship. A SubscriptionGraph is calculated every time
changes are pushed. Some branches are updated in these changes, and if these branches are
subscribed by other projects, SubscriptionGraph would record information about these updated
branches and branches/projects affected.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static interface
static class
-
Constructor Summary
ConstructorsConstructorDescriptionSubscriptionGraph
(Set<BranchNameKey> updatedBranches, com.google.common.collect.SetMultimap<BranchNameKey, SubmoduleSubscription> targets, com.google.common.collect.SetMultimap<Project.NameKey, BranchNameKey> branchesByProject, Set<BranchNameKey> subscribedBranches, Set<BranchNameKey> sortedBranches) -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableSet<BranchNameKey>
getAffectedSuperBranches
(Project.NameKey project) Returns all branches within the superprojectproject
which have submodule subscriptions.com.google.common.collect.ImmutableSet<Project.NameKey>
Get all superprojects affected.com.google.common.collect.ImmutableSet<BranchNameKey>
Get all affected branches, including the submodule branches and superproject branches, sorted by traversal order.com.google.common.collect.ImmutableSet<SubmoduleSubscription>
getSubscriptions
(BranchNameKey branch) Get all relatedSubmoduleSubscription
s whose super branch isbranch
.com.google.common.collect.ImmutableSet<BranchNameKey>
Get branches updated as part of the enclosing submit or push batch.boolean
hasSubscription
(BranchNameKey branch) See if abranch
is a superproject branch affected.boolean
hasSuperproject
(BranchNameKey branch) Check if abranch
is a submodule of a superproject.
-
Constructor Details
-
SubscriptionGraph
public SubscriptionGraph(Set<BranchNameKey> updatedBranches, com.google.common.collect.SetMultimap<BranchNameKey, SubmoduleSubscription> targets, com.google.common.collect.SetMultimap<Project.NameKey, BranchNameKey> branchesByProject, Set<BranchNameKey> subscribedBranches, Set<BranchNameKey> sortedBranches)
-
-
Method Details
-
getUpdatedBranches
Get branches updated as part of the enclosing submit or push batch. -
getAffectedSuperProjects
Get all superprojects affected. -
getAffectedSuperBranches
public com.google.common.collect.ImmutableSet<BranchNameKey> getAffectedSuperBranches(Project.NameKey project) Returns all branches within the superprojectproject
which have submodule subscriptions. -
getSortedSuperprojectAndSubmoduleBranches
public com.google.common.collect.ImmutableSet<BranchNameKey> getSortedSuperprojectAndSubmoduleBranches()Get all affected branches, including the submodule branches and superproject branches, sorted by traversal order.- See Also:
-
sortedBranches
-
hasSuperproject
Check if abranch
is a submodule of a superproject. -
hasSubscription
See if abranch
is a superproject branch affected. -
getSubscriptions
public com.google.common.collect.ImmutableSet<SubmoduleSubscription> getSubscriptions(BranchNameKey branch) Get all relatedSubmoduleSubscription
s whose super branch isbranch
.
-