public class PackBitmapIndexBuilder extends BasePackBitmapIndex
PackBitmapIndex
es.Modifier and Type | Class and Description |
---|---|
private static class |
PackBitmapIndexBuilder.PositionEntry |
static class |
PackBitmapIndexBuilder.StoredEntry
Data object for the on disk representation of a bitmap entry.
|
BasePackBitmapIndex.StoredBitmap
Modifier and Type | Field and Description |
---|---|
private com.googlecode.javaewah.EWAHCompressedBitmap |
blobs |
(package private) BlockList<BasePackBitmapIndex.StoredBitmap> |
byAddOrder |
private BlockList<PackBitmapIndexBuilder.PositionEntry> |
byOffset |
private com.googlecode.javaewah.EWAHCompressedBitmap |
commits |
private static int |
MAX_XOR_OFFSET_SEARCH |
(package private) ObjectIdOwnerMap<PackBitmapIndexBuilder.PositionEntry> |
positionEntries |
private com.googlecode.javaewah.EWAHCompressedBitmap |
tags |
private com.googlecode.javaewah.EWAHCompressedBitmap |
trees |
FLAG_REUSE, packChecksum
Constructor and Description |
---|
PackBitmapIndexBuilder(java.util.List<ObjectToPack> objects)
Creates a PackBitmapIndex used for building the contents of an index
file.
|
Modifier and Type | Method and Description |
---|---|
void |
addBitmap(AnyObjectId objectId,
BitmapIndex.Bitmap bitmap,
int flags)
Stores the bitmap for the objectId.
|
void |
addBitmap(AnyObjectId objectId,
com.googlecode.javaewah.EWAHCompressedBitmap bitmap,
int flags)
Stores the bitmap for the objectId.
|
void |
clearBitmaps()
Remove all the bitmaps entries added.
|
int |
findPosition(AnyObjectId objectId)
Finds the position in the bitmap of the object.
|
int |
getBitmapCount()
Returns the number of bitmaps in this bitmap index.
|
com.googlecode.javaewah.EWAHCompressedBitmap |
getBlobs()
Get the blob object bitmap.
|
com.googlecode.javaewah.EWAHCompressedBitmap |
getCommits()
Get the commit object bitmap.
|
java.lang.Iterable<PackBitmapIndexBuilder.StoredEntry> |
getCompressedBitmaps()
Get an iterator over the xor compressed entries.
|
ObjectId |
getObject(int position)
Get the object at the bitmap position.
|
int |
getObjectCount()
Obtain the total number of objects described by this index.
|
ObjectIdOwnerMap<ObjectIdOwnerMap.Entry> |
getObjectSet()
Get set of objects included in the pack.
|
int |
getOptions()
Get the index storage options.
|
com.googlecode.javaewah.EWAHCompressedBitmap |
getTags()
Get the tag object bitmap.
|
com.googlecode.javaewah.EWAHCompressedBitmap |
getTrees()
Get the tree object bitmap.
|
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 void |
sortByOffsetAndIndex(BlockList<PackBitmapIndexBuilder.PositionEntry> byOffset,
ObjectIdOwnerMap<PackBitmapIndexBuilder.PositionEntry> positionEntries,
java.util.List<ObjectToPack> entries) |
getBitmap, getBitmaps
open, read
private static final int MAX_XOR_OFFSET_SEARCH
private final com.googlecode.javaewah.EWAHCompressedBitmap commits
private final com.googlecode.javaewah.EWAHCompressedBitmap trees
private final com.googlecode.javaewah.EWAHCompressedBitmap blobs
private final com.googlecode.javaewah.EWAHCompressedBitmap tags
private final BlockList<PackBitmapIndexBuilder.PositionEntry> byOffset
final BlockList<BasePackBitmapIndex.StoredBitmap> byAddOrder
final ObjectIdOwnerMap<PackBitmapIndexBuilder.PositionEntry> positionEntries
public PackBitmapIndexBuilder(java.util.List<ObjectToPack> objects)
objects
- objects sorted by name. The list must be initially sorted by
ObjectId (name); it will be resorted in place.private static void sortByOffsetAndIndex(BlockList<PackBitmapIndexBuilder.PositionEntry> byOffset, ObjectIdOwnerMap<PackBitmapIndexBuilder.PositionEntry> positionEntries, java.util.List<ObjectToPack> entries)
public ObjectIdOwnerMap<ObjectIdOwnerMap.Entry> getObjectSet()
public void addBitmap(AnyObjectId objectId, BitmapIndex.Bitmap bitmap, int flags)
objectId
- the object id key for the bitmap.bitmap
- the bitmapflags
- the flags to be stored with the bitmappublic void addBitmap(AnyObjectId objectId, com.googlecode.javaewah.EWAHCompressedBitmap bitmap, int flags)
objectId
- the object id key for the bitmap.bitmap
- the bitmapflags
- the flags to be stored with the bitmappublic com.googlecode.javaewah.EWAHCompressedBitmap ofObjectType(com.googlecode.javaewah.EWAHCompressedBitmap bitmap, int type)
ofObjectType
in class PackBitmapIndex
bitmap
- the object bitmap.type
- the Git type.public int findPosition(AnyObjectId objectId)
findPosition
in class PackBitmapIndex
objectId
- the id for which the bitmap position will be found.public ObjectId getObject(int position) throws java.lang.IllegalArgumentException
getObject
in class PackBitmapIndex
position
- the id for which the object will be found.java.lang.IllegalArgumentException
- when the item is not found.public com.googlecode.javaewah.EWAHCompressedBitmap getCommits()
public com.googlecode.javaewah.EWAHCompressedBitmap getTrees()
public com.googlecode.javaewah.EWAHCompressedBitmap getBlobs()
public com.googlecode.javaewah.EWAHCompressedBitmap getTags()
public int getOptions()
public int getBitmapCount()
getBitmapCount
in class PackBitmapIndex
public void clearBitmaps()
public int getObjectCount()
getObjectCount() - 1
is the largest bit that will be set in a
bitmap.getObjectCount
in class PackBitmapIndex
public java.lang.Iterable<PackBitmapIndexBuilder.StoredEntry> getCompressedBitmaps()