Class BitmappedReachabilityChecker
- java.lang.Object
-
- org.eclipse.jgit.internal.revwalk.BitmappedReachabilityChecker
-
- All Implemented Interfaces:
ReachabilityChecker
public class BitmappedReachabilityChecker extends Object implements ReachabilityChecker
Checks the reachability using bitmaps.
-
-
Constructor Summary
Constructors Constructor Description BitmappedReachabilityChecker(RevWalk walk)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<RevCommit>
areAllReachable(Collection<RevCommit> targets, Stream<RevCommit> starters)
Check all targets are reachable from the starters.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.jgit.revwalk.ReachabilityChecker
areAllReachable
-
-
-
-
Constructor Detail
-
BitmappedReachabilityChecker
public BitmappedReachabilityChecker(RevWalk walk) throws IOException
- Parameters:
walk
- walk on the repository to get or create the bitmaps for the commits. It must have bitmaps.- Throws:
AssertionError
- runtime exception if walk is over a repository without bitmapsIOException
- if the index or the object reader cannot be opened.
-
-
Method Detail
-
areAllReachable
public Optional<RevCommit> areAllReachable(Collection<RevCommit> targets, Stream<RevCommit> starters) throws MissingObjectException, IncorrectObjectTypeException, IOException
Check all targets are reachable from the starters.In this implementation, it is recommended to put the most popular starters (e.g. refs/heads tips) at the beginning.
- Specified by:
areAllReachable
in interfaceReachabilityChecker
- Parameters:
targets
- commits to reach.starters
- known starting points.- Returns:
- An unreachable target if at least one of the targets is unreachable. An empty optional if all targets are reachable from the starters.
- Throws:
MissingObjectException
- if any of the incoming objects doesn't exist in the repository.IncorrectObjectTypeException
- if any of the incoming objects is not a commit or a tag.IOException
- if any of the underlying indexes or readers can not be opened.
-
-