org.eclipse.jgit.internal.storage.dfs.DfsRefDatabase that uses
reftable for storage.
A DfsRefDatabase instance is thread-safe.
Implementors may wish to use
org.
as the primary key identifier for a
org. only pack
description, ensuring that when there are competing transactions one wins,
and one will fail.
| Modifier and Type | Field and Description |
|---|---|
| private DfsReader | |
| pack-priv final ReftableDatabase | |
| private DfsReftableStack |
| Access | Constructor and Description |
|---|---|
| protected | DfsReftableDatabase(DfsRepository
the repository this database instance manages references for. repo)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)Overrides org. 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 | |
| protected boolean | Returns: true if commit of a new small reftable should try to
replace a prior small reftable by performing a compaction,
instead of extending the stack depth.Whether to compact reftable instead of extending the stack depth. |
| protected boolean | compareAndPut(Ref
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)Implements abstract org. Compare a reference, and put if it matches. |
| protected boolean | compareAndRemove(Ref
the old reference information that was previously read. oldRef)Implements abstract org. Compare a reference, and delete if it matches. |
| public Ref | exactRef(String
the unabbreviated name of the reference. name)Overrides org. Read a single reference. |
| pack-priv boolean | |
| protected ReentrantLock | Returns: the lock protecting this instance's state.Get the lock protecting this instance's state. |
| public ReflogReader | getReflogReader(Ref
a Ref ref)Implements abstract org. Get the reflog reader. |
| 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.Overrides org. Get a section of the reference namespace. |
| public List | getRefsByPrefix(String
string that names of refs should start with; may be empty (to
return all refs). prefix)Overrides org. Returns refs whose names start with a given prefix. |
| public List | getRefsByPrefixWithExclusions(String
string that names of refs should start with; may be empty. include, Set<String> strings that names of refs can't start with; may be empty. excludes)Overrides org. Returns refs whose names start with a given prefix excluding all refs that start with one of the given prefixes. |
| public ReftableConfig | Returns: configuration to write new reftables with.Get configuration to write new reftables with. |
| public Set | getTipsWithSha1(ObjectId
ObjectId to resolveOverrides org. Returns all refs that resolve directly to the given |
| public boolean | hasFastTipsWithSha1()
Overrides org. If the ref database does not support fast inverse queries, it may be advantageous to build a complete SHA1 to ref map in advance for multiple uses. |
| public boolean | hasVersioning()
Overrides org. With versioning, each reference has a version number that increases on update. |
| public boolean | isNameConflicting(String
proposed name. refName)Overrides org. Determine if a proposed reference name overlaps with an existing one. |
| public BatchRefUpdate | newBatchUpdate()
Overrides org. Create a new batch update to attempt on this database. |
| public Ref | peel(Ref
The reference to peel ref)Overrides org. Peel a possibly unpeeled reference by traversing the annotated tags. |
| public boolean | performsAtomicTransactions()
Overrides org. Whether the database is capable of performing batch updates as atomic transactions. |
| pack-priv void | |
| protected DfsRefDatabase. | scanAllRefs()
Implements abstract org. Read all known references in the repository. |
| protected DfsReftableStack | |
| pack-priv void |
| ctx | back to summary |
|---|---|
| private DfsReader ctx | |
| reftableDatabase | back to summary |
|---|---|
| pack-priv final ReftableDatabase reftableDatabase | |
| stack | back to summary |
|---|---|
| private DfsReftableStack stack | |
| DfsReftableDatabase | back to summary |
|---|---|
| protected DfsReftableDatabase(DfsRepository repo) Initialize the reference database for a repository.
| |
| cachePeeledState | back to summary |
|---|---|
| protected void cachePeeledState(Ref oldLeaf, Ref newLeaf) Overrides org. Doc from org. 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() Overrides org.
| |
| compactDuringCommit | back to summary |
|---|---|
| protected boolean compactDuringCommit() Whether to compact reftable instead of extending the stack depth.
| |
| compareAndPut | back to summary |
|---|---|
| protected boolean compareAndPut(Ref oldRef, Ref newRef) throws IOException Implements abstract org. Doc from org. Compare a reference, and put if it matches. Two reference match if and only if they satisfy the following:
| |
| compareAndRemove | back to summary |
|---|---|
| protected boolean compareAndRemove(Ref oldRef) throws IOException Implements abstract org. Doc from org. Compare a reference, and delete if it matches.
| |
| exactRef | back to summary |
|---|---|
| public Ref exactRef(String name) throws IOException Overrides org. Doc from org. Read a single reference.
Unlike
| |
| exists | back to summary |
|---|---|
| pack-priv boolean exists() throws IOException Overrides org.
| |
| getLock | back to summary |
|---|---|
| protected ReentrantLock getLock() Get the lock protecting this instance's state.
| |
| getReflogReader | back to summary |
|---|---|
| public ReflogReader getReflogReader(Ref ref) throws IOException Implements abstract org. Doc from org. Get the reflog reader.
| |
| getRefs | back to summary |
|---|---|
| public Map Overrides org. Doc from org. Get a section of the reference namespace.
| |
| getRefsByPrefix | back to summary |
|---|---|
| public List Overrides org. Doc from org. Returns refs whose names start with a given prefix.
The default implementation uses
| |
| getRefsByPrefixWithExclusions | back to summary |
|---|---|
| public List Overrides org. Doc from org. Returns refs whose names start with a given prefix excluding all refs that start with one of the given prefixes.
The default implementation is not efficient. Implementors of
| |
| getReftableConfig | back to summary |
|---|---|
| public ReftableConfig getReftableConfig() Get configuration to write new reftables with.
| |
| getTipsWithSha1 | back to summary |
|---|---|
| public Set Overrides org. Doc from org. Returns all refs that resolve directly to the given
The default implementation uses a linear scan. Implementors of
| |
| hasFastTipsWithSha1 | back to summary |
|---|---|
| public boolean hasFastTipsWithSha1() throws IOException Overrides org. Doc from org. If the ref database does not support fast inverse queries, it may be advantageous to build a complete SHA1 to ref map in advance for multiple uses. To let applications decide on this decision, this function indicates whether the inverse map is available.
| |
| hasVersioning | back to summary |
|---|---|
| public boolean hasVersioning() Overrides org. Doc from org. With versioning, each reference has a version number that increases on
update. See
| |
| isNameConflicting | back to summary |
|---|---|
| public boolean isNameConflicting(String refName) throws IOException Overrides 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.
| |
| newBatchUpdate | back to summary |
|---|---|
| public BatchRefUpdate newBatchUpdate() Overrides org. Doc from org. Create a new batch update to attempt on this database. The default implementation performs a sequential update of each command.
| |
| peel | back to summary |
|---|---|
| public Ref peel(Ref ref) throws IOException Overrides 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
| |
| performsAtomicTransactions | back to summary |
|---|---|
| public boolean performsAtomicTransactions() Overrides org. Doc from org. Whether the database is capable of performing batch updates as atomic transactions.
If true, by default
If false,
This definition of atomicity is stronger than what is provided by
| |
| removed | back to summary |
|---|---|
| pack-priv void removed(String refName) Overrides org.
| |
| scanAllRefs | back to summary |
|---|---|
| protected DfsRefDatabase. Implements abstract org. Doc from org. Read all known references in the repository.
| |
| stack | back to summary |
|---|---|
| protected DfsReftableStack stack() throws IOException Obtain a handle to the stack of reftables. Must hold lock.
| |
| stored | back to summary |
|---|---|
| pack-priv void stored(Ref ref) Overrides org.
| |