Top Description Fields Constructors Methods
org.eclipse.jgit.internal.storage.commitgraph

pack-priv Class GraphObjectIndex

extends Object
Class Inheritance
Imports
org.eclipse.jgit.annotations.NonNull, org.eclipse.jgit.internal.JGitText, org.eclipse.jgit.lib.AnyObjectId, .ObjectId, org.eclipse.jgit.util.NB

The index which are used by the commit-graph to:

Field Summary

Modifier and TypeField and Description
private final long
private static final int
private final int[]
private final int
private final byte[]

Constructor Summary

AccessConstructor and Description
pack-priv
GraphObjectIndex(int
length of object hash.
hashLength
,
byte[]
content of OID Fanout Chunk.
oidFanout
,
byte[]
content of OID Lookup Chunk.
oidLookup
)

Initialize the GraphObjectIndex.

Method Summary

Modifier and TypeMethod and Description
pack-priv int

Returns:

the commit-graph position or -1 if the object was not found.
findGraphPosition
(AnyObjectId
the id for which the commit-graph position will be found.
id
)

Find the position in the commit-graph of the specified id.

pack-priv long
pack-priv ObjectId

Returns:

the ObjectId or null if it's not found.
getObjectId
(int
the position in the commit-graph of the object.
graphPos
)

Get the object at the commit-graph position.

private int
objIdOffset(int pos)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

commitCntback to summary
private final long commitCnt
FANOUTback to summary
private static final int FANOUT
fanoutTableback to summary
private final int[] fanoutTable
hashLengthback to summary
private final int hashLength
oidLookupback to summary
private final byte[] oidLookup

Constructor Detail

GraphObjectIndexback to summary
pack-priv GraphObjectIndex(int hashLength, byte[] oidFanout, byte[] oidLookup) throws CommitGraphFormatException

Initialize the GraphObjectIndex.

Parameters
hashLength:int

length of object hash.

oidFanout:byte[]

content of OID Fanout Chunk.

oidLookup:byte[]

content of OID Lookup Chunk.

Exceptions
CommitGraphFormatException:
commit-graph file's format is different from we expected.

Method Detail

findGraphPositionback to summary
pack-priv int findGraphPosition(AnyObjectId id)

Find the position in the commit-graph of the specified id.

Parameters
id:AnyObjectId

the id for which the commit-graph position will be found.

Returns:int

the commit-graph position or -1 if the object was not found.

getCommitCntback to summary
pack-priv long getCommitCnt()
getObjectIdback to summary
pack-priv ObjectId getObjectId(int graphPos)

Get the object at the commit-graph position.

Parameters
graphPos:int

the position in the commit-graph of the object.

Returns:ObjectId

the ObjectId or null if it's not found.

objIdOffsetback to summary
private int objIdOffset(int pos)