]> source.dussan.org Git - jgit.git/commit
Added read/write support for pack bitmap index. 39/7939/17
authorColby Ranger <cranger@google.com>
Tue, 28 Aug 2012 16:08:20 +0000 (09:08 -0700)
committerColby Ranger <cranger@google.com>
Tue, 5 Mar 2013 19:09:44 +0000 (11:09 -0800)
commit3b325917a5c928caadd88a0ec718b1632f088fd5
tree07608fe74199d7ffec96524aa89299deb020155c
parent234b4e0432bc376964fe753eeb1119ef08cefe49
Added read/write support for pack bitmap index.

A pack bitmap index is an additional index of compressed
bitmaps of the object graph. Furthermore, a logical API of the index
functionality is included, as it is expected to be used by the
PackWriter.

Compressed bitmaps are created using the javaewah library, which is a
word-aligned compressed variant of the Java bitset class based on
run-length encoding. The library only works with positive integer
values. Thus, the maximum number of ObjectIds in a pack file that
this index can currently support is limited to Integer.MAX_VALUE.

Every ObjectId is given an integer mapping. The integer is the
position of the ObjectId in the complete ObjectId list, sorted
by offset, for the pack file. That integer is what the bitmaps
use to reference the ObjectId. Currently, the new index format can
only be used with pack files that contain a complete closure of the
object graph e.g. the result of a garbage collection.

The index file includes four bitmaps for the Git object types i.e.
commits, trees, blobs, and tags. In addition, a collection of
bitmaps keyed by an ObjectId is also included. The bitmap for each entry
in the collection represents the full closure of ObjectIds reachable
from the keyed ObjectId (including the keyed ObjectId itself). The
bitmaps are further compressed by XORing the current bitmaps against
prior bitmaps in the index, and selecting the smallest representation.
The XOR'd bitmap and offset from the current entry to the position
of the bitmap to XOR against is the actual representation of the entry
in the index file. Each entry contains one byte, which is currently
used to note whether the bitmap should be blindly reused.

Change-Id: Id328724bf6b4c8366a088233098c18643edcf40f
32 files changed:
org.eclipse.jgit.test/META-INF/MANIFEST.MF
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/InflatingBitSetTest.java [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/StoredBitmapTest.java [new file with mode: 0644]
org.eclipse.jgit/META-INF/MANIFEST.MF
org.eclipse.jgit/pom.xml
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/BitmapIndex.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/lib/BitmapObject.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackDescription.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackFile.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsReader.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/BasePackBitmapIndex.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/BitSet.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/BitmapIndexImpl.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/CachedObjectDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileObjectDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/InflatingBitSet.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackBitmapIndex.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackBitmapIndexBuilder.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackBitmapIndexV1.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackBitmapIndexWriterV1.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackReverseIndex.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/SimpleDataInput.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/SimpleDataOutput.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCursor.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackExt.java
org.eclipse.jgit/src/org/eclipse/jgit/util/NB.java
pom.xml