Top Description Inners Fields Constructors Methods
org.eclipse.jgit.revwalk

public final Class BitmapWalker

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.Arrays, org.eclipse.jgit.errors.IncorrectObjectTypeException, .MissingObjectException, org.eclipse.jgit.internal.revwalk.AddToBitmapFilter, .AddToBitmapWithCacheFilter, .AddUnseenToBitmapFilter, org.eclipse.jgit.lib.AnyObjectId, .BitmapIndex, .BitmapIndex.Bitmap, .BitmapIndex.BitmapBuilder, .NullProgressMonitor, .ObjectId, .ProgressMonitor, org.eclipse.jgit.revwalk.filter.ObjectFilter

Helper class to do ObjectWalks with pack index bitmaps.
Since
4.10

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
BitmapWalker.BitmapObjectFilter

Filter that excludes objects already in the given bitmap.

Field Summary

Modifier and TypeField and Description
private final BitmapIndex
private long
private final ProgressMonitor
private BitmapIndex.Bitmap
private AnyObjectId
private final ObjectWalk

Constructor Summary

AccessConstructor and Description
public
BitmapWalker(ObjectWalk
walker to use when traversing the object graph.
walker
,
BitmapIndex
index to obtain bitmaps from.
bitmapIndex
,
ProgressMonitor
progress monitor to report progress on.
pm
)

Create a BitmapWalker.

Method Summary

Modifier and TypeMethod and Description
public BitmapIndex.BitmapBuilder

Returns:

as a bitmap, the objects reachable from the objects in start.
findObjects
(Iterable<? extends ObjectId>
the objects to start the object traversal from.
start
,
BitmapIndex.BitmapBuilder
the objects to skip if encountered during traversal.
seen
,
boolean
true to ignore missing objects, false otherwise.
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)

public long

Returns:

the number of objects that had to be walked because they were not covered by a bitmap.
getCountOfBitmapIndexMisses
()

Return the number of objects that had to be walked because they were not covered by a bitmap.

public void
setPrevBitmap(BitmapIndex.Bitmap
the bitmap associated with the cached commit.
prevBitmap
)

Set the bitmap associated with the cached commit for the walker.

public void
setPrevCommit(AnyObjectId
the cached commit.
prevCommit
)

Set the cached commit for the walker.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bitmapIndexback to summary
private final BitmapIndex bitmapIndex
countOfBitmapIndexMissesback to summary
private long countOfBitmapIndexMisses
pmback to summary
private final ProgressMonitor pm
prevBitmapback to summary
private BitmapIndex.Bitmap prevBitmap
prevCommitback to summary
private AnyObjectId prevCommit
walkerback to summary
private final ObjectWalk walker

Constructor Detail

BitmapWalkerback to summary
public BitmapWalker(ObjectWalk walker, BitmapIndex bitmapIndex, ProgressMonitor pm)

Create a BitmapWalker.

Parameters
walker:ObjectWalk

walker to use when traversing the object graph.

bitmapIndex:BitmapIndex

index to obtain bitmaps from.

pm:ProgressMonitor

progress monitor to report progress on.

Method Detail

findObjectsback to summary
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:Iterable<? extends ObjectId>

the objects to start the object traversal from.

seen:BitmapIndex.BitmapBuilder

the objects to skip if encountered during traversal.

ignoreMissing:boolean

true to ignore missing objects, false otherwise.

Returns:BitmapIndex.BitmapBuilder

as a bitmap, the objects reachable from the objects in start.

Exceptions
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 to org.eclipse.jgit.revwalk.RevWalk#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 a org.eclipse.jgit.revwalk.RevWalk#lookupAny(AnyObjectId, int) call.
IOException:
a pack file or loose object could not be read.
findObjectsWalkback to summary
private BitmapIndex.BitmapBuilder findObjectsWalk(Iterable<? extends ObjectId> start, BitmapIndex.BitmapBuilder seen, boolean ignoreMissingStart) throws MissingObjectException, IncorrectObjectTypeException, IOException
getCountOfBitmapIndexMissesback to summary
public long getCountOfBitmapIndexMisses()

Return the number of objects that had to be walked because they were not covered by a bitmap.

Returns:long

the number of objects that had to be walked because they were not covered by a bitmap.

setPrevBitmapback to summary
public void setPrevBitmap(BitmapIndex.Bitmap prevBitmap)

Set the bitmap associated with the cached commit for the walker.

Parameters
prevBitmap:BitmapIndex.Bitmap

the bitmap associated with the cached commit.

Since
5.8
setPrevCommitback to summary
public void setPrevCommit(AnyObjectId prevCommit)

Set the cached commit for the walker.

Parameters
prevCommit:AnyObjectId

the cached commit.

Since
5.8
org.eclipse.jgit.revwalk back to summary

pack-priv Class BitmapWalker.BitmapObjectFilter

extends ObjectFilter
Class Inheritance

Filter that excludes objects already in the given bitmap.

Field Summary

Modifier and TypeField and Description
private final BitmapIndex.BitmapBuilder
Inherited from org.eclipse.jgit.revwalk.filter.ObjectFilter:
ALL

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final boolean
include(ObjectWalk
the active walker this filter is being invoked from within.
walker
,
AnyObjectId
the object currently being tested.
objid
)

Implements abstract org.eclipse.jgit.revwalk.filter.ObjectFilter.include.

Determine if the named object should be included in the walk.

Field Detail

bitmapback to summary
private final BitmapIndex.BitmapBuilder bitmap

Constructor Detail

BitmapObjectFilterback to summary
pack-priv BitmapObjectFilter(BitmapIndex.BitmapBuilder bitmap)

Method Detail

includeback to summary
public final boolean include(ObjectWalk walker, AnyObjectId objid) throws MissingObjectException, IncorrectObjectTypeException, IOException

Implements abstract org.eclipse.jgit.revwalk.filter.ObjectFilter.include.

Doc from org.eclipse.jgit.revwalk.filter.ObjectFilter.include.

Determine if the named object should be included in the walk.

Parameters
walker:ObjectWalk

the active walker this filter is being invoked from within.

objid:AnyObjectId

the object currently being tested.

Returns:boolean

true if the named object should be included in the walk.

Annotations
@Override
Exceptions
MissingObjectException:
an object the filter needed to consult to determine its answer was missing
IncorrectObjectTypeException:
an object the filter needed to consult to determine its answer was of the wrong type
IOException:
an object the filter needed to consult to determine its answer could not be read.