Class IterativeConnectivityChecker
java.lang.Object
org.eclipse.jgit.internal.transport.connectivity.IterativeConnectivityChecker
- All Implemented Interfaces:
ConnectivityChecker
Implementation of connectivity checker which tries to do check with smaller
set of references first and if it fails will fall back to check against all
advertised references.
This is useful for big repos with enormous number of references.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jgit.transport.ConnectivityChecker
ConnectivityChecker.ConnectivityCheckInfo
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkConnectivity
(ConnectivityChecker.ConnectivityCheckInfo connectivityCheckInfo, Set<ObjectId> advertisedHaves, ProgressMonitor pm) Checks connectivity of the commit graph after pack uploading.getAllObjectIds
(List<ReceiveCommand> commands) parseParents
(RevCommit[] parents, RevWalk rw) void
setForcedHaves
(Set<ObjectId> forcedHaves) Sets additional haves that client can depend on (e.g.
-
Field Details
-
MAXIMUM_PARENTS_TO_CHECK
private static final int MAXIMUM_PARENTS_TO_CHECK- See Also:
-
delegate
-
forcedHaves
-
-
Constructor Details
-
IterativeConnectivityChecker
- Parameters:
delegate
- Delegate checker which will be called for actual checks.
-
-
Method Details
-
checkConnectivity
public void checkConnectivity(ConnectivityChecker.ConnectivityCheckInfo connectivityCheckInfo, Set<ObjectId> advertisedHaves, ProgressMonitor pm) throws MissingObjectException, IOException Description copied from interface:ConnectivityChecker
Checks connectivity of the commit graph after pack uploading.- Specified by:
checkConnectivity
in interfaceConnectivityChecker
- Parameters:
connectivityCheckInfo
- Input for the connectivity check.advertisedHaves
- Set of references known for client.pm
- Monitor to publish progress to.- Throws:
IOException
- an error occurred during connectivity checking.MissingObjectException
-
getAllObjectIds
-
setForcedHaves
Sets additional haves that client can depend on (e.g. gerrit changes).- Parameters:
forcedHaves
- Haves server expects client to depend on.
-
extractAdvertisedParentCommits
private static Set<ObjectId> extractAdvertisedParentCommits(Set<ObjectId> newRefs, Set<ObjectId> advertisedHaves, RevWalk rw) throws MissingObjectException, IOException - Throws:
MissingObjectException
IOException
-
parseParents
-