Modifier and Type | Field and Description |
---|---|
private long |
bucketSize
The number of bytes per entry in the offsetIndex.
|
private PackIndex |
index
Index we were created from, and that has our ObjectId data.
|
private int[] |
nth
Mapping from indices in offset order to indices in SHA-1 order.
|
private int[] |
offsetIndex
An index into the nth mapping, where the value is the position after the
the last index that contains the values of the bucket.
|
Constructor and Description |
---|
PackReverseIndex(PackIndex packIndex)
Create reverse index from straight/forward pack index, by indexing all
its entries.
|
Modifier and Type | Method and Description |
---|---|
private int |
binarySearch(long offset) |
long |
findNextOffset(long offset,
long maxOffset)
Search for the next offset to the specified offset in this pack (reverse)
index.
|
ObjectId |
findObject(long offset)
Search for object id with the specified start offset in this pack
(reverse) index.
|
(package private) ObjectId |
findObjectByPosition(int nthPosition) |
(package private) int |
findPostion(long offset) |
private final PackIndex index
private final long bucketSize
private final int[] offsetIndex
binarySearch(long)
private final int[] nth
public PackReverseIndex(PackIndex packIndex)
packIndex
- forward index - entries to (reverse) index.public ObjectId findObject(long offset)
offset
- start offset of object to find.public long findNextOffset(long offset, long maxOffset) throws CorruptObjectException
offset
- start offset of previous object (must be valid-existing
offset).maxOffset
- maximum offset in a pack (returned when there is no next
offset).CorruptObjectException
- when there is no object with the provided offset.int findPostion(long offset)
private int binarySearch(long offset)
ObjectId findObjectByPosition(int nthPosition)