protected class InMemoryRepository.MemRefDatabase extends DfsRefDatabase
This class is protected (and not private) to facilitate testing using subclasses of InMemoryRepository.
DfsRefDatabase.RefCacheALL, MAX_SYMBOLIC_REF_DEPTH, SEARCH_PATH| Modifier | Constructor and Description |
|---|---|
protected |
MemRefDatabase()
Initialize a new in-memory ref database.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
compareAndPut(Ref oldRef,
Ref newRef)
Compare a reference, and put if it matches.
|
protected boolean |
compareAndRemove(Ref oldRef)
Compare a reference, and delete if it matches.
|
BatchRefUpdate |
newBatchUpdate()
Create a new batch update to attempt on this database.
|
boolean |
performsAtomicTransactions()
Whether the database is capable of performing batch updates as atomic
transactions.
|
protected DfsRefDatabase.RefCache |
scanAllRefs()
Read all known references in the repository.
|
cachePeeledState, close, create, exactRef, getAdditionalRefs, getRef, getRefs, getRepository, isNameConflicting, newRename, newUpdate, peel, refreshexactRef, findRef, firstExactRef, getConflictingNamesprotected MemRefDatabase()
public boolean performsAtomicTransactions()
RefDatabase
If true, by default BatchRefUpdate instances will perform updates
atomically, meaning either all updates will succeed, or all updates will
fail. It is still possible to turn off this behavior on a per-batch basis
by calling update.setAtomic(false).
If false, BatchRefUpdate instances will never perform updates
atomically, and calling update.setAtomic(true) will cause the
entire batch to fail with REJECTED_OTHER_REASON.
This definition of atomicity is stronger than what is provided by
ReceivePack. ReceivePack will
attempt to reject all commands if it knows in advance some commands may
fail, even if the storage layer does not support atomic transactions. Here,
atomicity applies even in the case of unforeseeable errors.
performsAtomicTransactions in class RefDatabasepublic BatchRefUpdate newBatchUpdate()
RefDatabaseThe default implementation performs a sequential update of each command.
newBatchUpdate in class RefDatabaseprotected DfsRefDatabase.RefCache scanAllRefs() throws IOException
DfsRefDatabasescanAllRefs in class DfsRefDatabaseIOException - references cannot be accessed.protected boolean compareAndPut(Ref oldRef, Ref newRef) throws IOException
DfsRefDatabaseTwo reference match if and only if they satisfy the following:
compareAndPut in class DfsRefDatabaseoldRef - old value to compare to. If the reference is expected to not
exist the old value has a storage of
Ref.Storage.NEW and an ObjectId
value of null.newRef - new reference to store.IOException - the reference cannot be put due to a system error.protected boolean compareAndRemove(Ref oldRef) throws IOException
DfsRefDatabasecompareAndRemove in class DfsRefDatabaseoldRef - the old reference information that was previously read.IOException - the reference could not be removed due to a system error.Copyright © 2017 Eclipse JGit Project. All rights reserved.