Class PackBitmapIndexV1

    • Field Detail

      • MAGIC

        static final byte[] MAGIC
      • executor

        private static final java.util.concurrent.ExecutorService executor
      • packIndex

        private final PackIndex packIndex
      • 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
    • Method Detail

      • findPosition

        public int findPosition​(AnyObjectId objectId)
        Finds the position in the bitmap of the object.
        Specified by:
        findPosition in class PackBitmapIndex
        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 class PackBitmapIndex
        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 class PackBitmapIndex
        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 class PackBitmapIndex
        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 class PackBitmapIndex
        Returns:
        the number of bitmaps in this bitmap index.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • readBitmap

        private static com.googlecode.javaewah.EWAHCompressedBitmap readBitmap​(java.io.DataInput dataInput)
                                                                        throws java.io.IOException
        Throws:
        java.io.IOException