Package org.eclipse.jgit.revwalk
Class BitmapWalker
java.lang.Object
org.eclipse.jgit.revwalk.BitmapWalker
Helper class to do ObjectWalks with pack index bitmaps.
- Since:
- 4.10
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
Filter that excludes objects already in the given bitmap. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BitmapIndex
private long
private final ProgressMonitor
private BitmapIndex.Bitmap
private AnyObjectId
private final ObjectWalk
-
Constructor Summary
ConstructorsConstructorDescriptionBitmapWalker
(ObjectWalk walker, BitmapIndex bitmapIndex, ProgressMonitor pm) Create a BitmapWalker. -
Method Summary
Modifier and TypeMethodDescriptionfindObjects
(Iterable<? extends ObjectId> start, BitmapIndex.BitmapBuilder seen, boolean ignoreMissing) Return, as a bitmap, the objects reachable from the objects in start.private BitmapIndex.BitmapBuilder
findObjectsWalk
(Iterable<? extends ObjectId> start, BitmapIndex.BitmapBuilder seen, boolean ignoreMissingStart) long
Return the number of objects that had to be walked because they were not covered by a bitmap.void
setPrevBitmap
(BitmapIndex.Bitmap prevBitmap) Set the bitmap associated with the cached commit for the walker.void
setPrevCommit
(AnyObjectId prevCommit) Set the cached commit for the walker.
-
Field Details
-
walker
-
bitmapIndex
-
pm
-
countOfBitmapIndexMisses
private long countOfBitmapIndexMisses -
prevCommit
-
prevBitmap
-
-
Constructor Details
-
BitmapWalker
Create a BitmapWalker.- Parameters:
walker
- walker to use when traversing the object graph.bitmapIndex
- index to obtain bitmaps from.pm
- progress monitor to report progress on.
-
-
Method Details
-
setPrevCommit
Set the cached commit for the walker.- Parameters:
prevCommit
- the cached commit.- Since:
- 5.8
-
setPrevBitmap
Set the bitmap associated with the cached commit for the walker.- Parameters:
prevBitmap
- the bitmap associated with the cached commit.- Since:
- 5.8
-
getCountOfBitmapIndexMisses
public long getCountOfBitmapIndexMisses()Return the number of objects that had to be walked because they were not covered by a bitmap.- Returns:
- the number of objects that had to be walked because they were not covered by a bitmap.
-
findObjects
public BitmapIndex.BitmapBuilder findObjects(Iterable<? extends ObjectId> start, BitmapIndex.BitmapBuilder seen, boolean ignoreMissing) throws MissingObjectException, IncorrectObjectTypeException, IOException Return, as a bitmap, the objects reachable from the objects in start.- Parameters:
start
- the objects to start the object traversal from.seen
- the objects to skip if encountered during traversal.ignoreMissing
- true to ignore missing objects, false otherwise.- Returns:
- as a bitmap, the objects reachable from the objects in start.
- Throws:
MissingObjectException
- the object supplied is not available from the object database. This usually indicates the supplied object is invalid, but the reference was constructed during an earlier invocation toRevWalk.lookupAny(AnyObjectId, int)
.IncorrectObjectTypeException
- the object was not parsed yet and it was discovered during parsing that it is not actually the type of the instance passed in. This usually indicates the caller used the wrong type in aRevWalk.lookupAny(AnyObjectId, int)
call.IOException
- a pack file or loose object could not be read.
-
findObjectsWalk
private BitmapIndex.BitmapBuilder findObjectsWalk(Iterable<? extends ObjectId> start, BitmapIndex.BitmapBuilder seen, boolean ignoreMissingStart) throws MissingObjectException, IncorrectObjectTypeException, IOException
-