java.lang.Object
org.eclipse.jgit.internal.storage.file.PackBitmapIndexBuilder
- All Implemented Interfaces:
PackBitmapIndex
Helper for constructing
PackBitmapIndexes.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classData object for the on disk representation of a bitmap entry.Nested classes/interfaces inherited from interface org.eclipse.jgit.internal.storage.file.PackBitmapIndex
PackBitmapIndex.SupplierWithIOException<T> -
Field Summary
Fields inherited from interface org.eclipse.jgit.internal.storage.file.PackBitmapIndex
FLAG_REUSE -
Constructor Summary
ConstructorsConstructorDescriptionPackBitmapIndexBuilder(List<ObjectToPack> objects) Creates a PackBitmapIndex used for building the contents of an index file. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBitmap(AnyObjectId objectId, com.googlecode.javaewah.EWAHCompressedBitmap bitmap, int flags) Stores the bitmap for the objectId.voidaddBitmap(AnyObjectId objectId, BitmapIndex.Bitmap bitmap, int flags) Stores the bitmap for the objectId.intfindPosition(AnyObjectId objectId) Finds the position in the bitmap of the object.intReturns the number of bitmaps in this bitmap index ready to use, not XOR'ed against other entries.longCurrent size in bytes of all base bitmaps in the index.com.googlecode.javaewah.EWAHCompressedBitmapgetBitmap(AnyObjectId objectId) Returns the previously constructed bitmap for the object.intReturns the number of bitmaps in this bitmap index.com.googlecode.javaewah.EWAHCompressedBitmapgetBlobs()Get the blob object bitmap.com.googlecode.javaewah.EWAHCompressedBitmapGet the commit object bitmap.Get list of xor compressed entries that need to be written.getObject(int position) Get the object at the bitmap position.intObtain the total number of objects described by this index.Get set of objects included in the pack.intGet the index storage options.com.googlecode.javaewah.EWAHCompressedBitmapgetTags()Get the tag object bitmap.com.googlecode.javaewah.EWAHCompressedBitmapgetTrees()Get the tree object bitmap.intReturns the number of bitmaps in this bitmap index XOR'ed against other entries.longCurrent size in bytes of all XOR'ed bitmaps in the index.com.googlecode.javaewah.EWAHCompressedBitmapofObjectType(com.googlecode.javaewah.EWAHCompressedBitmap bitmap, int type) Returns a bitmap containing positions for objects that have the given Git type.voidprocessBitmapForWrite(BitmapCommit c, BitmapIndex.Bitmap bitmap, int flags) Processes a commit and prepares its bitmap to write to the bitmap index file.voidresetBitmaps(int size) Remove all the bitmaps entries added.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.jgit.internal.storage.file.PackBitmapIndex
getPackChecksum
-
Constructor Details
-
PackBitmapIndexBuilder
Creates a PackBitmapIndex used for building the contents of an index file.- Parameters:
objects- objects sorted by name. The list must be initially sorted by ObjectId (name); it will be resorted in place.
-
-
Method Details
-
getObjectSet
Get set of objects included in the pack.- Returns:
- set of objects included in the pack.
-
addBitmap
Stores the bitmap for the objectId.- Parameters:
objectId- the object id key for the bitmap.bitmap- the bitmapflags- the flags to be stored with the bitmap
-
processBitmapForWrite
Processes a commit and prepares its bitmap to write to the bitmap index file.- Parameters:
c- the commit corresponds to the bitmap.bitmap- the bitmap to be written.flags- the flags of the commit.
-
addBitmap
public void addBitmap(AnyObjectId objectId, com.googlecode.javaewah.EWAHCompressedBitmap bitmap, int flags) Stores the bitmap for the objectId.- Parameters:
objectId- the object id key for the bitmap.bitmap- the bitmapflags- the flags to be stored with the bitmap
-
ofObjectType
public com.googlecode.javaewah.EWAHCompressedBitmap ofObjectType(com.googlecode.javaewah.EWAHCompressedBitmap bitmap, int type) Description copied from interface:PackBitmapIndexReturns a bitmap containing positions for objects that have the given Git type.- Parameters:
bitmap- the object bitmap.type- the Git type.- Returns:
- the object bitmap with only objects of the Git type.
-
findPosition
Description copied from interface:PackBitmapIndexFinds the position in the bitmap of the object.- 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
Description copied from interface:PackBitmapIndexGet the object at the bitmap position.- Parameters:
position- the offset in the bitmap which corresponds to an object of interest. This position is the same as the order of the object in thePackFile.- Returns:
- the ObjectId.
- Throws:
IllegalArgumentException- when the item is not found.
-
getCommits
public com.googlecode.javaewah.EWAHCompressedBitmap getCommits()Get the commit object bitmap.- Returns:
- the commit object bitmap.
-
getTrees
public com.googlecode.javaewah.EWAHCompressedBitmap getTrees()Get the tree object bitmap.- Returns:
- the tree object bitmap.
-
getBlobs
public com.googlecode.javaewah.EWAHCompressedBitmap getBlobs()Get the blob object bitmap.- Returns:
- the blob object bitmap.
-
getTags
public com.googlecode.javaewah.EWAHCompressedBitmap getTags()Get the tag object bitmap.- Returns:
- the tag object bitmap.
-
getOptions
public int getOptions()Get the index storage options.- Returns:
- the index storage options.
-
getBitmapCount
public int getBitmapCount()Description copied from interface:PackBitmapIndexReturns the number of bitmaps in this bitmap index.- Returns:
- the number of bitmaps in this bitmap index.
-
resetBitmaps
public void resetBitmaps(int size) Remove all the bitmaps entries added.- Parameters:
size- the expected number of bitmap entries to be written.
-
getObjectCount
public int getObjectCount()Description copied from interface:PackBitmapIndexObtain the total number of objects described by this index.getObjectCount() - 1is the largest bit that will be set in a bitmap.- Returns:
- number of objects in this index, and likewise in the associated pack that this index was generated from.
-
getCompressedBitmaps
Get list of xor compressed entries that need to be written.- Returns:
- a list of the xor compressed entries.
-
getBitmap
Description copied from interface:PackBitmapIndexReturns the previously constructed bitmap for the object.- Specified by:
getBitmapin interfacePackBitmapIndex- Parameters:
objectId- the id for which the bitmap will be found.- Returns:
- the bitmap or null if the object was not found.
-
getBaseBitmapCount
public int getBaseBitmapCount()Description copied from interface:PackBitmapIndexReturns the number of bitmaps in this bitmap index ready to use, not XOR'ed against other entries.- Specified by:
getBaseBitmapCountin interfacePackBitmapIndex- Returns:
- the number of bitmaps in this bitmap index ready to use.
-
getBaseBitmapSizeInBytes
public long getBaseBitmapSizeInBytes()Description copied from interface:PackBitmapIndexCurrent size in bytes of all base bitmaps in the index. Resolving xors for bitmaps can affect this size.- Specified by:
getBaseBitmapSizeInBytesin interfacePackBitmapIndex- Returns:
- Current size (in bytes) of all base bitmaps in this index.
-
getXorBitmapCount
public int getXorBitmapCount()Description copied from interface:PackBitmapIndexReturns the number of bitmaps in this bitmap index XOR'ed against other entries.- Specified by:
getXorBitmapCountin interfacePackBitmapIndex- Returns:
- the number of bitmaps in this bitmap index represented as XOR masks.
-
getXorBitmapSizeInBytes
public long getXorBitmapSizeInBytes()Description copied from interface:PackBitmapIndexCurrent size in bytes of all XOR'ed bitmaps in the index. Resolving xors for bitmaps can affect this size.- Specified by:
getXorBitmapSizeInBytesin interfacePackBitmapIndex- Returns:
- Current size (in bytes) of all xor bitmaps in this index.
-