Reverse index for forward pack index. Provides operations based on offset instead of object id. Such offset-based reverse lookups are performed in O(log n) time.
PackIndex, Pack
| Modifier and Type | Field and Description |
|---|---|
| public static final byte[] | MAGIC
Magic bytes that uniquely identify git reverse index files. |
| public static final int | VERSION_1
The first reverse index file version. |
| Modifier and Type | Method and Description |
|---|---|
| public long | Returns: offset of the next object in a pack or maxOffset if provided offset was the last one.start offset of previous object (must be valid-existing
offset). offset, long maximum offset in a pack (returned when there is no next
offset). maxOffset)Search for the next offset to the specified offset in this pack (reverse) index. |
| public ObjectId | Returns: object id for this offset, or null if no object was found.start offset of object to find. offset)Search for object id with the specified start offset in this pack (reverse) index. |
| public ObjectId | Returns: the object in that positionthe position of the object in the reverse index nthPosition)Find the object that is in the given position in the reverse index. |
| public int | Returns: the position in the reverse index of the objectthe pack offset of the object offset)Find the position in the reverse index of the object at the given pack offset. |
| public void | verifyPackChecksum(String
the path to display in event of a mismatch packFilePath)Verify that the pack checksum found in the reverse index matches that from the pack file. |
| MAGIC | back to summary |
|---|---|
| public static final byte[] MAGIC Magic bytes that uniquely identify git reverse index files. | |
| VERSION_1 | back to summary |
|---|---|
| public static final int VERSION_1 The first reverse index file version. | |
| findNextOffset | back to summary |
|---|---|
| public long findNextOffset(long offset, long maxOffset) throws CorruptObjectException Search for the next offset to the specified offset in this pack (reverse) index.
| |
| findObject | back to summary |
|---|---|
| public ObjectId findObject(long offset) Search for object id with the specified start offset in this pack (reverse) index.
| |
| findObjectByPosition | back to summary |
|---|---|
| public ObjectId findObjectByPosition(int nthPosition) Find the object that is in the given position in the reverse index.
| |
| findPosition | back to summary |
|---|---|
| public int findPosition(long offset) Find the position in the reverse index of the object at the given pack offset.
| |
| verifyPackChecksum | back to summary |
|---|---|
| public void verifyPackChecksum(String packFilePath) throws PackMismatchException Verify that the pack checksum found in the reverse index matches that from the pack file.
| |