org.eclipse.jgit.dircache.DirCache
extension.
A valid cache tree record contains the object id of a tree object and the
total number of org. instances
(counted recursively) from the DirCache contained within the tree. This
information facilitates faster traversal of the index and quicker generation
of tree objects prior to creating a new commit.
An invalid cache tree record indicates a known subtree whose file entries have changed in ways that cause the tree to no longer have a known object id. Invalid cache tree records must be revalidated prior to use.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private DirCacheTree[] | children
Child trees, if any, sorted by |
| pack-priv byte[] | encodedName
Name of this tree within its parent. |
| private int | entrySpan
Number of |
| private ObjectId | id
Unique SHA-1 of this tree; null if invalid. |
| private static final DirCacheTree[] | |
| private static final byte[] | |
| private DirCacheTree | parent
Tree this tree resides in; null if we are the root. |
| private static final Comparator |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| private | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private int | |
| pack-priv final boolean | |
| public DirCacheTree | |
| public int | Returns: number of child trees available through this tree.Get the number of cached subtrees contained within this tree. |
| public int | Returns: total number of entries (recursively) contained within this tree.Get the number of entries this tree spans within the DirCache. |
| public String | Returns: name of the tree. This does not contain any '/' characters.Get the tree's name within its parent. |
| public ObjectId | |
| public String | Returns: path of the tree, relative to the repository root. If this is not the root tree the path ends with '/'. The root tree's path string is the empty string ("").Get the tree's path within the repository. |
| private void | |
| public boolean | Returns: true if this tree is knows key details about itself; false if the tree needs to be regenerated.Determine if this cache is currently valid. |
| private static int | |
| pack-priv final int | |
| pack-priv static boolean | |
| private void | |
| private static int | |
| public String | |
| pack-priv void | validate(final DirCacheEntry[]
the complete cache from DirCache. cache, final int number of entries in cCnt, int cache that are valid for
iteration.first position of cIdx, final int cache that is a member of this
tree. The path of cache[cacheIdx].path for the
range [0,pathOff-1) matches the complete path of
this tree, from the root of the repository.number of bytes of pathOff)cache[cacheIdx].path that
matches this tree's path. The value at array position
cache[cacheIdx].path[pathOff-1] is always '/' if
pathOff is > 0.Update (if necessary) this tree's entrySpan. |
| pack-priv void | |
| pack-priv ObjectId | Returns: identity of this tree.the complete cache from DirCache. cache, int first position of cIdx, final int cache that is a member of this
tree. The path of cache[cacheIdx].path for the
range [0,pathOff-1) matches the complete path of
this tree, from the root of the repository.number of bytes of pathOffset, final ObjectInserter cache[cacheIdx].path that
matches this tree's path. The value at array position
cache[cacheIdx].path[pathOff-1] is always '/' if
pathOff is > 0.the writer to use when serializing to the store. ow)Write (if necessary) this tree to the object store. |
| childCnt | back to summary |
|---|---|
| private int childCnt Number of valid children in | |
| children | back to summary |
|---|---|
| private DirCacheTree[] children Child trees, if any, sorted by | |
| encodedName | back to summary |
|---|---|
| pack-priv byte[] encodedName Name of this tree within its parent. | |
| entrySpan | back to summary |
|---|---|
| private int entrySpan Number of | |
| id | back to summary |
|---|---|
| private ObjectId id Unique SHA-1 of this tree; null if invalid. | |
| NO_CHILDREN | back to summary |
|---|---|
| private static final DirCacheTree[] NO_CHILDREN | |
| NO_NAME | back to summary |
|---|---|
| private static final byte[] NO_NAME | |
| parent | back to summary |
|---|---|
| private DirCacheTree parent Tree this tree resides in; null if we are the root. | |
| TREE_CMP | back to summary |
|---|---|
| private static final Comparator<DirCacheTree> TREE_CMP | |
| DirCacheTree | back to summary |
|---|---|
| pack-priv DirCacheTree() | |
| DirCacheTree | back to summary |
|---|---|
| private DirCacheTree(final DirCacheTree myParent, final byte[] path, final int pathOff, final int pathLen) | |
| DirCacheTree | back to summary |
|---|---|
| pack-priv DirCacheTree(final byte[] in, final MutableInteger off, final DirCacheTree myParent) | |
| appendName | back to summary |
|---|---|
| private void appendName(StringBuilder r) | |
| computeSize | back to summary |
|---|---|
| private int computeSize(final DirCacheEntry[] cache, int cIdx, final int pathOffset, final ObjectInserter ow) throws UnmergedPathException, IOException | |
| contains | back to summary |
|---|---|
| pack-priv final boolean contains(byte[] a, int aOff, int aLen) | |
| getChild | back to summary |
|---|---|
| public DirCacheTree getChild(int i) Get the i-th child cache tree.
| |
| getChildCount | back to summary |
|---|---|
| public int getChildCount() Get the number of cached subtrees contained within this tree.
| |
| getEntrySpan | back to summary |
|---|---|
| public int getEntrySpan() Get the number of entries this tree spans within the DirCache.
If this tree is not valid (see
| |
| getNameString | back to summary |
|---|---|
| public String getNameString() Get the tree's name within its parent. This method is not very efficient and is primarily meant for debugging and final output generation. Applications should try to avoid calling it, and if invoked do so only once per interesting entry, where the name is absolutely required for correct function.
| |
| getObjectId | back to summary |
|---|---|
| public ObjectId getObjectId() Get the tree's ObjectId.
If
| |
| getPathString | back to summary |
|---|---|
| public String getPathString() Get the tree's path within the repository. This method is not very efficient and is primarily meant for debugging and final output generation. Applications should try to avoid calling it, and if invoked do so only once per interesting entry, where the name is absolutely required for correct function.
| |
| insertChild | back to summary |
|---|---|
| private void insertChild(int stIdx, DirCacheTree st) | |
| isValid | back to summary |
|---|---|
| public boolean isValid() Determine if this cache is currently valid.
A valid cache tree knows how many
| |
| namecmp | back to summary |
|---|---|
| private static int namecmp(byte[] a, int aPos, DirCacheTree ct) | |
| nameLength | back to summary |
|---|---|
| pack-priv final int nameLength() | |
| peq | back to summary |
|---|---|
| pack-priv static boolean peq(byte[] a, byte[] b, int aLen) | |
| removeChild | back to summary |
|---|---|
| private void removeChild(int stIdx) | |
| slash | back to summary |
|---|---|
| private static int slash(byte[] a, int aPos) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| validate | back to summary |
|---|---|
| pack-priv void validate(final DirCacheEntry[] cache, final int cCnt, int cIdx, final int pathOff) Update (if necessary) this tree's entrySpan.
| |
| write | back to summary |
|---|---|
| pack-priv void write(byte[] tmp, OutputStream os) throws IOException | |
| writeTree | back to summary |
|---|---|
| pack-priv ObjectId writeTree(final DirCacheEntry[] cache, int cIdx, final int pathOffset, final ObjectInserter ow) throws UnmergedPathException, IOException Write (if necessary) this tree to the object store.
| |