| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| pack-priv byte[][] | |
| private final long[] | |
| private long | |
| protected byte[] | packChecksum
Footer checksum applied on the bottom of the pack file. |
| private static final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public long | findCRC32(AnyObjectId
id of object to look for objId)Implements org. Retrieve stored CRC32 checksum of the requested object raw-data (including header). |
| private int | |
| public long | findOffset(AnyObjectId
name of the object to locate within the pack. objId)Implements org. Locate the file offset position for the requested object. |
| public int | findPosition(AnyObjectId
name of the object to locate within the index objId)Implements org. Locate the position of this id in the list of object-ids in the index |
| public byte[] | getChecksum()
Implements org. Get pack checksum |
| private int | |
| public long | getObjectCount()
Implements org. Obtain the total number of objects described by this index. |
| public ObjectId | getObjectId(long
position within the traversal of nthPosition)iterator() that the
caller needs the object for. The first returned
org.
is 0, the second is 1, etc.Implements org. Get ObjectId for the n-th object entry returned by |
| public long | getOffset(long
unsigned 32 bit position within the traversal of
nthPosition)iterator() for which the caller needs the offset. The
first returned MutableEntry is 0, the second is 1,
etc. Positions past 2**31-1 are negative, but still valid.Implements org. Get offset in a pack for the n-th object entry returned by
|
| public long | getOffset64Count()
Implements org. Obtain the total number of objects needing 64 bit offsets. |
| public boolean | hasCRC32Support()
Implements org. Check whether this index supports (has) CRC32 checksums for objects. |
| private static int | |
| public Iterator | iterator()
Implements org. Returns an iterator over elements of type |
| private int | Returns: position in the byte[] where the objectId starts. -1 if not found.ObjectId we are looking for objId, byte[] Blob of second level data with a series of (offset, objectid)
pairs where we should find objId data)Find position in level two data of this objectId Records are (offset, objectId), so to read the corresponding offset, caller must substract from this position. |
| public void | resolve(Set<ObjectId>
set to add any located ObjectIds to. This is an output
parameter. matches, AbbreviatedObjectId prefix to search for. id, int maximum number of results to return. At most this many
ObjectIds should be added to matches before returning. matchLimit)Implements org. Find objects matching the prefix abbreviation. |
| IDX_HDR_LEN | back to summary |
|---|---|
| private static final int IDX_HDR_LEN | |
| idxdata | back to summary |
|---|---|
| pack-priv byte[][] idxdata | |
| idxHeader | back to summary |
|---|---|
| private final long[] idxHeader | |
| objectCnt | back to summary |
|---|---|
| private long objectCnt | |
| packChecksum | back to summary |
|---|---|
| protected byte[] packChecksum Footer checksum applied on the bottom of the pack file. | |
| RECORD_SIZE | back to summary |
|---|---|
| private static final int RECORD_SIZE | |
| PackIndexV1 | back to summary |
|---|---|
| pack-priv PackIndexV1(final InputStream fd, final byte[] hdr) throws CorruptObjectException, IOException | |
| findCRC32 | back to summary |
|---|---|
| public long findCRC32(AnyObjectId objId) Implements org. Doc from org. Retrieve stored CRC32 checksum of the requested object raw-data (including header).
| |
| findLevelOne | back to summary |
|---|---|
| private int findLevelOne(long nthPosition) | |
| findOffset | back to summary |
|---|---|
| public long findOffset(AnyObjectId objId) Implements org. Doc from org. Locate the file offset position for the requested object.
| |
| findPosition | back to summary |
|---|---|
| public int findPosition(AnyObjectId objId) Implements org. Doc from org. Locate the position of this id in the list of object-ids in the index
| |
| getChecksum | back to summary |
|---|---|
| public byte[] getChecksum() Implements org. Doc from org. Get pack checksum
| |
| getLevelTwo | back to summary |
|---|---|
| private int getLevelTwo(long nthPosition, int levelOne) | |
| getObjectCount | back to summary |
|---|---|
| public long getObjectCount() Implements org. Doc from org. Obtain the total number of objects described by this index.
| |
| getObjectId | back to summary |
|---|---|
| public ObjectId getObjectId(long nthPosition) Implements org. Doc from org. Get ObjectId for the n-th object entry returned by This method is a constant-time replacement for the following loop: Iterator<MutableEntry> eItr = index.iterator(); int curPosition = 0; while (eItr.hasNext() && curPosition++ < nthPosition) eItr.next(); ObjectId result = eItr.next().toObjectId();
| |
| getOffset | back to summary |
|---|---|
| public long getOffset(long nthPosition) Implements org. Doc from org. Get offset in a pack for the n-th object entry returned by
| |
| getOffset64Count | back to summary |
|---|---|
| public long getOffset64Count() Implements org. Doc from org. Obtain the total number of objects needing 64 bit offsets.
| |
| hasCRC32Support | back to summary |
|---|---|
| public boolean hasCRC32Support() Implements org. Doc from org. Check whether this index supports (has) CRC32 checksums for objects.
| |
| idOffset | back to summary |
|---|---|
| private static int idOffset(int mid) | |
| iterator | back to summary |
|---|---|
| public Iterator Implements org. Doc from org. Returns an iterator over elements of type Provide iterator that gives access to index entries. Note, that iterator returns reference to mutable object, the same reference in each call - for performance reason. If client needs immutable objects, it must copy returned object on its own. Iterator returns objects in SHA-1 lexicographical order.
| |
| levelTwoPosition | back to summary |
|---|---|
| private int levelTwoPosition(AnyObjectId objId, byte[] data) Find position in level two data of this objectId Records are (offset, objectId), so to read the corresponding offset, caller must substract from this position.
| |
| resolve | back to summary |
|---|---|
| public void resolve(Set<ObjectId> matches, AbbreviatedObjectId id, int matchLimit) throws IOException Implements org. Doc from org. Find objects matching the prefix abbreviation.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private final PackIndexV1 |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected void | readNext()
Implements abstract org. Used by subclasses to load the next entry into the MutableEntry. |
| levelOne | back to summary |
|---|---|
| private int levelOne | |
| levelTwo | back to summary |
|---|---|
| private int levelTwo | |
| packIndex | back to summary |
|---|---|
| private final PackIndexV1 packIndex | |
| EntriesIteratorV1 | back to summary |
|---|---|
| private EntriesIteratorV1(PackIndexV1 packIndex) | |
| readNext | back to summary |
|---|---|
| protected void readNext() Implements abstract org. Doc from org. Used by subclasses to load the next entry into the MutableEntry.
Subclasses are expected to populate the entry with
| |