Package org.eclipse.jgit.revwalk
Class BitmapWalker
- java.lang.Object
-
- org.eclipse.jgit.revwalk.BitmapWalker
-
public final class BitmapWalker extends Object
Helper class to do ObjectWalks with pack index bitmaps.- Since:
- 4.10
-
-
Constructor Summary
Constructors Constructor Description BitmapWalker(ObjectWalk walker, BitmapIndex bitmapIndex, ProgressMonitor pm)
Create a BitmapWalker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BitmapIndex.BitmapBuilder
findObjects(Iterable<? extends ObjectId> start, BitmapIndex.BitmapBuilder seen, boolean ignoreMissing)
Return, as a bitmap, the objects reachable from the objects in start.long
getCountOfBitmapIndexMisses()
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.
-
-
-
Constructor Detail
-
BitmapWalker
public BitmapWalker(ObjectWalk walker, BitmapIndex bitmapIndex, ProgressMonitor pm)
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 Detail
-
setPrevCommit
public void setPrevCommit(AnyObjectId prevCommit)
Set the cached commit for the walker.- Parameters:
prevCommit
- the cached commit.- Since:
- 5.8
-
setPrevBitmap
public void setPrevBitmap(BitmapIndex.Bitmap prevBitmap)
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.
-
-