Top Description Fields Constructors Methods
org.eclipse.jgit.internal.transport.connectivity

public Class IterativeConnectivityChecker

extends Object
implements ConnectivityChecker
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.transport.ConnectivityChecker
Static Imports
java.util.stream.Collectors.toList

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.

Field Summary

Modifier and TypeField and Description
private final ConnectivityChecker
private Set<ObjectId>
private static final int

Constructor Summary

AccessConstructor and Description
public
IterativeConnectivityChecker(ConnectivityChecker
Delegate checker which will be called for actual checks.
delegate
)

Method Summary

Modifier and TypeMethod and Description
public void
checkConnectivity(ConnectivityChecker.ConnectivityCheckInfo
Input for the connectivity check.
connectivityCheckInfo
,
Set<ObjectId>
Set of references known for client.
advertisedHaves
,
ProgressMonitor
Monitor to publish progress to.
pm
)

Implements org.eclipse.jgit.transport.ConnectivityChecker.checkConnectivity.

Checks connectivity of the commit graph after pack uploading.

private static Set<ObjectId>
private static Stream<ObjectId>
private static List<RevCommit>
public void
setForcedHaves(Set<ObjectId>
Haves server expects client to depend on.
forcedHaves
)

Sets additional haves that client can depend on (e.g. gerrit changes).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delegateback to summary
private final ConnectivityChecker delegate
forcedHavesback to summary
private Set<ObjectId> forcedHaves
MAXIMUM_PARENTS_TO_CHECKback to summary
private static final int MAXIMUM_PARENTS_TO_CHECK

Constructor Detail

IterativeConnectivityCheckerback to summary
public IterativeConnectivityChecker(ConnectivityChecker delegate)
Parameters
delegate:ConnectivityChecker

Delegate checker which will be called for actual checks.

Method Detail

checkConnectivityback to summary
public void checkConnectivity(ConnectivityChecker.ConnectivityCheckInfo connectivityCheckInfo, Set<ObjectId> advertisedHaves, ProgressMonitor pm) throws MissingObjectException, IOException

Implements org.eclipse.jgit.transport.ConnectivityChecker.checkConnectivity.

Doc from org.eclipse.jgit.transport.ConnectivityChecker.checkConnectivity.

Checks connectivity of the commit graph after pack uploading.

Parameters
connectivityCheckInfo:ConnectivityChecker.ConnectivityCheckInfo

Input for the connectivity check.

advertisedHaves:Set<ObjectId>

Set of references known for client.

pm:ProgressMonitor

Monitor to publish progress to.

Annotations
@Override
Exceptions
IOException:
an error occurred during connectivity checking.
extractAdvertisedParentCommitsback to summary
private static Set<ObjectId> extractAdvertisedParentCommits(Set<ObjectId> newRefs, Set<ObjectId> advertisedHaves, RevWalk rw) throws MissingObjectException, IOException
getAllObjectIdsback to summary
private static Stream<ObjectId> getAllObjectIds(List<ReceiveCommand> commands)
parseParentsback to summary
private static List<RevCommit> parseParents(RevCommit[] parents, RevWalk rw)
setForcedHavesback to summary
public void setForcedHaves(Set<ObjectId> forcedHaves)

Sets additional haves that client can depend on (e.g. gerrit changes).

Parameters
forcedHaves:Set<ObjectId>

Haves server expects client to depend on.