- All Superinterfaces:
Iterable<MultiPackIndex.MutableEntry>
An index over multiple packs
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAn peekable iterator for the midxstatic classEntry from the midx with object id, pack id, offset (in pack)static class(packId, offset) coordinates of an object -
Method Summary
Modifier and TypeMethodDescriptionfind(AnyObjectId objectId) Obtain the location of the object.intReturn the position in offset order (i.e. ridx or bitmap position) for the (packId, offset) pair.intfindPosition(AnyObjectId objectId) Position of the object in this midx, when all covered objects are ordered by SHA1.byte[]Index checksum of the contents of this midx filelongMemory size of this multipack indexgetObjectAt(int position) ObjectId at this position in the midxgetObjectAtBitmapPosition(int bitmapPosition) Object id at the specified position in offset order (i.e. position in the ridx or bitmap)intNumber of objects in this midxString[]Obtain the array of packfiles in the MultiPackIndex.booleanhasObject(AnyObjectId oid) Does this index contains the objectiterator()Return an iterator over the local objects in this midx.voidresolve(Set<ObjectId> matches, AbbreviatedObjectId id, int matchLimit) Find objects matching the prefix abbreviation.Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getPackNames
String[] getPackNames()Obtain the array of packfiles in the MultiPackIndex.The pack ids correspond to positions in this list.
- Returns:
- array of packnames refered in this multipack index
-
hasObject
Does this index contains the object- Parameters:
oid- object id- Returns:
- true of the index knows this the object
-
find
Obtain the location of the object.The returned object can be reused by the implementations. Callers must create a #copy() if they want to keep a reference.
- Parameters:
objectId- objectId to read.- Returns:
- mutable instance with the location or null if not found.
-
findPosition
Position of the object in this midx, when all covered objects are ordered by SHA1.As the midx removes duplicates, this position is NOT equivalent to "position in pack + total count of objects in previous packs in the stack".
- Parameters:
objectId- an object id- Returns:
- position of the object in this multipack index
-
findBitmapPosition
Return the position in offset order (i.e. ridx or bitmap position) for the (packId, offset) pair.- Parameters:
po- a location in the midx (packId, offset)- Returns:
- the position in the midx, in offset order
-
getObjectAtBitmapPosition
Object id at the specified position in offset order (i.e. position in the ridx or bitmap)- Parameters:
bitmapPosition- position in the bitmap- Returns:
- object id at that position.
-
getObjectAt
ObjectId at this position in the midx- Parameters:
position- position inside this midx in sha1 order- Returns:
- the object id at that position
-
getObjectCount
int getObjectCount()Number of objects in this midxThis number doesn't match with the sum of objects in each covered pack because midx removes duplicates.
- Returns:
- number of objects in this midx
-
resolve
Find objects matching the prefix abbreviation.- Parameters:
matches- set to add any located ObjectIds to. This is an output parameter.id- prefix to search for.matchLimit- maximum number of results to return. At most this many ObjectIds should be added to matches before returning.
-
getChecksum
byte[] getChecksum()Index checksum of the contents of this midx file- Returns:
- checksum of the contents of this midx file
-
getMemorySize
long getMemorySize()Memory size of this multipack index- Returns:
- size of this multipack index in memory, in bytes
-
iterator
MultiPackIndex.MidxIterator iterator()Return an iterator over the local objects in this midx.In chained midxs, this iterator does not include the base midx.
- Specified by:
iteratorin interfaceIterable<MultiPackIndex.MutableEntry>- Returns:
- iterator in sha1 order of the objects in this midx
-