| Modifier and Type | Class and Description |
|---|---|
| public static class | DfsRefDatabase.
Collection of references managed by this database. |
| Modifier and Type | Field and Description |
|---|---|
| private final AtomicReference | |
| private final DfsRepository |
| Access | Constructor and Description |
|---|---|
| protected | DfsRefDatabase(DfsRepository
the repository this database instance manages references for. repository)Initialize the reference database for a repository. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | cachePeeledState(Ref
the old reference. oldLeaf, Ref the new reference, with peel information. newLeaf)Update the cached peeled state of a reference The ref database invokes this method after it peels a reference that had not been peeled before. |
| pack-priv void | |
| public void | close()
Implements abstract org. Close any resources held by this database. |
| protected abstract boolean | Returns: true if the put was successful; false otherwise.old value to compare to. If the reference is expected to not
exist the old value has a storage of
oldRef, Ref org. and an ObjectId
value of null.new reference to store. newRef)Compare a reference, and put if it matches. |
| protected abstract boolean | Returns: true if the remove was successful; false otherwise.the old reference information that was previously read. oldRef)Compare a reference, and delete if it matches. |
| public void | create()
Implements abstract org. Initialize a new reference database at this location. |
| pack-priv Ref | |
| public Ref | exactRef(String
the unabbreviated name of the reference. name)Implements abstract org. Read a single reference. |
| pack-priv boolean | |
| public List | getAdditionalRefs()
Implements abstract org. Get the additional reference-like entities from the repository. |
| public Map | getRefs(String
prefix to search the namespace with; must end with prefix)/.
If the empty string (ALL), obtain a complete snapshot
of all references.Implements abstract org. Get a section of the reference namespace. |
| protected DfsRepository | Returns: the repository the database holds the references of.Get the repository the database holds the references of. |
| public boolean | isNameConflicting(String
proposed name. refName)Implements abstract org. Determine if a proposed reference name overlaps with an existing one. |
| public RefRename | newRename(String
name of reference to rename from fromName, String name of reference to rename to toName)Implements abstract org. Create a new update command to rename a reference. |
| public RefUpdate | newUpdate(String
the name of the reference. refName, boolean if detach)true and name is currently a
org., the update will
replace it with an org..
Otherwise, the update will recursively traverse
org.s and operate on the
leaf org..Implements abstract org. Create a new update command to create, modify or delete a reference. |
| public Ref | peel(Ref
The reference to peel ref)Implements abstract org. Peel a possibly unpeeled reference by traversing the annotated tags. |
| private DfsRefDatabase. | |
| pack-priv static Ref | |
| public void | refresh()
Overrides org. Triggers a refresh of all internal data structures. |
| pack-priv void | |
| private Ref | |
| protected abstract DfsRefDatabase. | Returns: all current references of the repository.Read all known references in the repository. |
| pack-priv void |
| cache | back to summary |
|---|---|
| private final AtomicReference<DfsRefDatabase. | |
| repository | back to summary |
|---|---|
| private final DfsRepository repository | |
| DfsRefDatabase | back to summary |
|---|---|
| protected DfsRefDatabase(DfsRepository repository) Initialize the reference database for a repository.
| |
| cachePeeledState | back to summary |
|---|---|
| protected void cachePeeledState(Ref oldLeaf, Ref newLeaf) Update the cached peeled state of a reference The ref database invokes this method after it peels a reference that had not been peeled before. This allows the storage to cache the peel state of the reference, and if it is actually peelable, the target that it peels to, so that on-the-fly peeling doesn't have to happen on the next reference read. | |
| clearCache | back to summary |
|---|---|
| pack-priv void clearCache() | |
| close | back to summary |
|---|---|
| public void close() Implements abstract org. Doc from org. Close any resources held by this database.
| |
| compareAndPut | back to summary |
|---|---|
| protected abstract boolean compareAndPut(Ref oldRef, Ref newRef) throws IOException Compare a reference, and put if it matches. Two reference match if and only if they satisfy the following:
| |
| compareAndRemove | back to summary |
|---|---|
| protected abstract boolean compareAndRemove(Ref oldRef) throws IOException Compare a reference, and delete if it matches.
| |
| create | back to summary |
|---|---|
| public void create() Implements abstract org. Doc from org. Initialize a new reference database at this location.
| |
| doPeel | back to summary |
|---|---|
| pack-priv Ref doPeel(Ref leaf) throws MissingObjectException, IOException | |
| exactRef | back to summary |
|---|---|
| public Ref exactRef(String name) throws IOException Implements abstract org. Doc from org. Read a single reference.
Unlike
| |
| exists | back to summary |
|---|---|
| pack-priv boolean exists() throws IOException | |
| getAdditionalRefs | back to summary |
|---|---|
| public List Implements abstract org. Doc from org. Get the additional reference-like entities from the repository.
The result list includes non-ref items such as MERGE_HEAD and
FETCH_RESULT cast to be refs. The names of these refs are not returned by
| |
| getRefs | back to summary |
|---|---|
| public Map Implements abstract org. Doc from org. Get a section of the reference namespace.
| |
| getRepository | back to summary |
|---|---|
| protected DfsRepository getRepository() Get the repository the database holds the references of.
| |
| isNameConflicting | back to summary |
|---|---|
| public boolean isNameConflicting(String refName) throws IOException Implements abstract org. Doc from org. Determine if a proposed reference name overlaps with an existing one. Reference names use '/' as a component separator, and may be stored in a hierarchical storage such as a directory on the local filesystem. If the reference "refs/heads/foo" exists then "refs/heads/foo/bar" must not exist, as a reference cannot have a value and also be a container for other references at the same time. If the reference "refs/heads/foo/bar" exists than the reference "refs/heads/foo" cannot exist, for the same reason.
| |
| newRename | back to summary |
|---|---|
| public RefRename newRename(String fromName, String toName) throws IOException Implements abstract org. Doc from org. Create a new update command to rename a reference.
| |
| newUpdate | back to summary |
|---|---|
| public RefUpdate newUpdate(String refName, boolean detach) throws IOException Implements abstract org. Doc from org. Create a new update command to create, modify or delete a reference.
| |
| peel | back to summary |
|---|---|
| public Ref peel(Ref ref) throws IOException Implements abstract org. Doc from org. Peel a possibly unpeeled reference by traversing the annotated tags.
If the reference cannot be peeled (as it does not refer to an annotated
tag) the peeled id stays null, but
Implementors should check
| |
| read | back to summary |
|---|---|
| private DfsRefDatabase. | |
| recreate | back to summary |
|---|---|
| pack-priv static Ref recreate(Ref old, Ref leaf, boolean hasVersioning) | |
| refresh | back to summary |
|---|---|
| public void refresh() Overrides org. Doc from org. Triggers a refresh of all internal data structures. In case the RefDatabase implementation has internal caches this method will trigger that all these caches are cleared. Implementors should overwrite this method if they use any kind of caches.
| |
| removed | back to summary |
|---|---|
| pack-priv void removed(String refName) | |
| resolve | back to summary |
|---|---|
| private Ref resolve(Ref ref, int depth, RefList<Ref> loose) throws IOException | |
| scanAllRefs | back to summary |
|---|---|
| protected abstract DfsRefDatabase. Read all known references in the repository.
| |
| stored | back to summary |
|---|---|
| pack-priv void stored(Ref ref) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final RefList | |
| pack-priv final RefList |
| Access | Constructor and Description |
|---|---|
| public | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Ref | |
| public DfsRefDatabase. | |
| public DfsRefDatabase. | |
| public int |
| ids | back to summary |
|---|---|
| pack-priv final RefList<Ref> ids | |
| sym | back to summary |
|---|---|
| pack-priv final RefList<Ref> sym | |
| RefCache | back to summary |
|---|---|
| public RefCache(RefList<Ref> ids, RefList<Ref> sym) Initialize a new reference cache. The two reference lists supplied must be sorted in correct order (string compare order) by name. | |
| RefCache | back to summary |
|---|---|
| pack-priv RefCache(RefList<Ref> ids, DfsRefDatabase. | |
| get | back to summary |
|---|---|
| public Ref get(String name) Find a reference by name. | |
| put | back to summary |
|---|---|
| public DfsRefDatabase. Obtain a modified copy of the cache with a ref stored. This cache instance is not modified by this method.
| |
| remove | back to summary |
|---|---|
| public DfsRefDatabase. Obtain a modified copy of the cache with the ref removed. This cache instance is not modified by this method.
| |
| size | back to summary |
|---|---|
| public int size() Get number of references
| |