java.lang.Object
org.eclipse.jgit.internal.storage.file.PackReverseIndex
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.
-
Constructor Summary
ConstructorsConstructorDescriptionPackReverseIndex(PackIndex packIndex) Create reverse index from straight/forward pack index, by indexing all its entries. -
Method Summary
Modifier and TypeMethodDescriptionlongfindNextOffset(long offset, long maxOffset) Search for the next offset to the specified offset in this pack (reverse) index.findObject(long offset) Search for object id with the specified start offset in this pack (reverse) index.
-
Constructor Details
-
PackReverseIndex
Create reverse index from straight/forward pack index, by indexing all its entries.- Parameters:
packIndex- forward index - entries to (reverse) index.
-
-
Method Details
-
findObject
Search for object id with the specified start offset in this pack (reverse) index.- Parameters:
offset- start offset of object to find.- Returns:
- object id for this offset, or null if no object was found.
-
findNextOffset
Search for the next offset to the specified offset in this pack (reverse) index.- Parameters:
offset- start offset of previous object (must be valid-existing offset).maxOffset- maximum offset in a pack (returned when there is no next offset).- Returns:
- offset of the next object in a pack or maxOffset if provided offset was the last one.
- Throws:
CorruptObjectException- when there is no object with the provided offset.
-