public abstract class PackBitmapIndex extends Object
ObjectId
s are encoded as a single integer in the
range [0, getObjectCount()
). Compressed bitmaps are available at
certain ObjectId
s, which represent all of the objects reachable from
that ObjectId
(include the ObjectId
itself). The meaning of
the positions in the bitmaps can be decoded using getObject(int)
and
ofObjectType(EWAHCompressedBitmap, int)
. Furthermore,
findPosition(AnyObjectId)
can be used to build other bitmaps that a
compatible with the encoded bitmaps available from the index.Modifier and Type | Field and Description |
---|---|
static int |
FLAG_REUSE
Flag bit denoting the bitmap should be reused during index creation.
|
Constructor and Description |
---|
PackBitmapIndex() |
Modifier and Type | Method and Description |
---|---|
abstract int |
findPosition(AnyObjectId objectId)
Finds the position in the bitmap of the object.
|
abstract com.googlecode.javaewah.EWAHCompressedBitmap |
getBitmap(AnyObjectId objectId)
Returns the previously constructed bitmap for the object.
|
abstract int |
getBitmapCount()
Returns the number of bitmaps in this bitmap index.
|
abstract ObjectId |
getObject(int position)
Get the object at the bitmap position.
|
abstract int |
getObjectCount()
Obtain the total number of objects described by this index.
|
abstract com.googlecode.javaewah.EWAHCompressedBitmap |
ofObjectType(com.googlecode.javaewah.EWAHCompressedBitmap bitmap,
int type)
Returns a bitmap containing positions for objects that have the given Git
type.
|
static PackBitmapIndex |
open(File idxFile,
PackIndex packIndex,
PackReverseIndex reverseIndex)
Read an existing pack bitmap index file from a buffered stream.
|
static PackBitmapIndex |
read(InputStream fd,
PackIndex packIndex,
PackReverseIndex reverseIndex)
Read an existing pack bitmap index file from a buffered stream.
|
public static final int FLAG_REUSE
public static PackBitmapIndex open(File idxFile, PackIndex packIndex, PackReverseIndex reverseIndex) throws IOException
The format of the file will be automatically detected and a proper access implementation for that format will be constructed and returned to the caller. The file may or may not be held open by the returned instance.
idxFile
- existing pack .bitmap to read.packIndex
- the pack index for the corresponding pack file.reverseIndex
- the pack reverse index for the corresponding pack file.IOException
- the stream cannot be read.CorruptObjectException
- the stream does not contain a valid pack bitmap index.public static PackBitmapIndex read(InputStream fd, PackIndex packIndex, PackReverseIndex reverseIndex) throws IOException
The format of the file will be automatically detected and a proper access implementation for that format will be constructed and returned to the caller. The file may or may not be held open by the returned instance.
fd
- stream to read the bitmap index file from. The stream must be
buffered as some small IOs are performed against the stream.
The caller is responsible for closing the stream.packIndex
- the pack index for the corresponding pack file.reverseIndex
- the pack reverse index for the corresponding pack file.IOException
- the stream cannot be read.CorruptObjectException
- the stream does not contain a valid pack bitmap index.public abstract int findPosition(AnyObjectId objectId)
objectId
- the id for which the bitmap position will be found.public abstract ObjectId getObject(int position) throws IllegalArgumentException
position
- the id for which the object will be found.IllegalArgumentException
- when the item is not found.public abstract com.googlecode.javaewah.EWAHCompressedBitmap ofObjectType(com.googlecode.javaewah.EWAHCompressedBitmap bitmap, int type)
bitmap
- the object bitmap.type
- the Git type.public abstract com.googlecode.javaewah.EWAHCompressedBitmap getBitmap(AnyObjectId objectId)
objectId
- the id for which the bitmap will be found.public abstract int getObjectCount()
getObjectCount() - 1
is the largest bit that will be set in a
bitmap.public abstract int getBitmapCount()
Copyright © 2020 Eclipse JGit Project. All rights reserved.