Class PackBitmapIndexV1
- java.lang.Object
-
- org.eclipse.jgit.internal.storage.file.PackBitmapIndex
-
- org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex
-
- org.eclipse.jgit.internal.storage.file.PackBitmapIndexV1
-
class PackBitmapIndexV1 extends BasePackBitmapIndex
Support for the pack bitmap index v1 format.- See Also:
PackBitmapIndex
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
PackBitmapIndexV1.IdxPositionBitmap
Temporary holder of object position in pack index and other metadata forStoredBitmap
.-
Nested classes/interfaces inherited from class org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex
BasePackBitmapIndex.StoredBitmap
-
Nested classes/interfaces inherited from class org.eclipse.jgit.internal.storage.file.PackBitmapIndex
PackBitmapIndex.SupplierWithIOException<T>
-
-
Field Summary
Fields Modifier and Type Field Description private ObjectIdOwnerMap<BasePackBitmapIndex.StoredBitmap>
bitmaps
private com.googlecode.javaewah.EWAHCompressedBitmap
blobs
private com.googlecode.javaewah.EWAHCompressedBitmap
commits
private static java.util.concurrent.ExecutorService
executor
(package private) static byte[]
MAGIC
private static int
MAX_XOR_OFFSET
(package private) static int
OPT_FULL
private PackIndex
packIndex
private PackReverseIndex
reverseIndex
private com.googlecode.javaewah.EWAHCompressedBitmap
tags
private com.googlecode.javaewah.EWAHCompressedBitmap
trees
-
Fields inherited from class org.eclipse.jgit.internal.storage.file.PackBitmapIndex
FLAG_REUSE, packChecksum
-
-
Constructor Summary
Constructors Constructor Description PackBitmapIndexV1(java.io.InputStream fd, PackBitmapIndex.SupplierWithIOException<PackIndex> packIndexSupplier, PackBitmapIndex.SupplierWithIOException<PackReverseIndex> reverseIndexSupplier, boolean loadParallelRevIndex)
PackBitmapIndexV1(java.io.InputStream fd, PackIndex packIndex, PackReverseIndex reverseIndex)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
findPosition(AnyObjectId objectId)
Finds the position in the bitmap of the object.int
getBitmapCount()
Returns the number of bitmaps in this bitmap index.ObjectId
getObject(int position)
Get the object at the bitmap position.int
getObjectCount()
Obtain the total number of objects described by this index.(package private) PackIndex
getPackIndex()
int
hashCode()
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.private static com.googlecode.javaewah.EWAHCompressedBitmap
readBitmap(java.io.DataInput dataInput)
-
Methods inherited from class org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex
getBitmap, getBitmaps
-
Methods inherited from class org.eclipse.jgit.internal.storage.file.PackBitmapIndex
open, read, read
-
-
-
-
Field Detail
-
MAGIC
static final byte[] MAGIC
-
OPT_FULL
static final int OPT_FULL
- See Also:
- Constant Field Values
-
MAX_XOR_OFFSET
private static final int MAX_XOR_OFFSET
- See Also:
- Constant Field Values
-
executor
private static final java.util.concurrent.ExecutorService executor
-
packIndex
private final PackIndex packIndex
-
reverseIndex
private final PackReverseIndex reverseIndex
-
commits
private final com.googlecode.javaewah.EWAHCompressedBitmap commits
-
trees
private final com.googlecode.javaewah.EWAHCompressedBitmap trees
-
blobs
private final com.googlecode.javaewah.EWAHCompressedBitmap blobs
-
tags
private final com.googlecode.javaewah.EWAHCompressedBitmap tags
-
bitmaps
private final ObjectIdOwnerMap<BasePackBitmapIndex.StoredBitmap> bitmaps
-
-
Constructor Detail
-
PackBitmapIndexV1
PackBitmapIndexV1(java.io.InputStream fd, PackIndex packIndex, PackReverseIndex reverseIndex) throws java.io.IOException
- Throws:
java.io.IOException
-
PackBitmapIndexV1
PackBitmapIndexV1(java.io.InputStream fd, PackBitmapIndex.SupplierWithIOException<PackIndex> packIndexSupplier, PackBitmapIndex.SupplierWithIOException<PackReverseIndex> reverseIndexSupplier, boolean loadParallelRevIndex) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
findPosition
public int findPosition(AnyObjectId objectId)
Finds the position in the bitmap of the object.- Specified by:
findPosition
in classPackBitmapIndex
- Parameters:
objectId
- the id for which the bitmap position will be found.- Returns:
- the bitmap id or -1 if the object was not found.
-
getObject
public ObjectId getObject(int position) throws java.lang.IllegalArgumentException
Get the object at the bitmap position.- Specified by:
getObject
in classPackBitmapIndex
- Parameters:
position
- the id for which the object will be found.- Returns:
- the ObjectId.
- Throws:
java.lang.IllegalArgumentException
- when the item is not found.
-
getObjectCount
public int getObjectCount()
Obtain the total number of objects described by this index.getObjectCount() - 1
is the largest bit that will be set in a bitmap.- Specified by:
getObjectCount
in classPackBitmapIndex
- Returns:
- number of objects in this index, and likewise in the associated pack that this index was generated from.
-
ofObjectType
public 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.- Specified by:
ofObjectType
in classPackBitmapIndex
- Parameters:
bitmap
- the object bitmap.type
- the Git type.- Returns:
- the object bitmap with only objects of the Git type.
-
getBitmapCount
public int getBitmapCount()
Returns the number of bitmaps in this bitmap index.- Specified by:
getBitmapCount
in classPackBitmapIndex
- Returns:
- the number of bitmaps in this bitmap index.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getPackIndex
PackIndex getPackIndex()
-
readBitmap
private static com.googlecode.javaewah.EWAHCompressedBitmap readBitmap(java.io.DataInput dataInput) throws java.io.IOException
- Throws:
java.io.IOException
-
-