public class InMemoryRepository extends DfsRepository
This implementation builds on the DFS repository by storing all reference and object data in the local process. It is not very efficient and exists only for unit testing and small experiments.
The repository is thread-safe. Memory used is released only when this object is garbage collected. Closing the repository has no impact on its memory.
Modifier and Type | Class and Description |
---|---|
static class |
InMemoryRepository.Builder
Builder for in-memory repositories.
|
private static class |
InMemoryRepository.ByteArrayReadableChannel |
static class |
InMemoryRepository.MemObjDatabase
DfsObjDatabase used by InMemoryRepository.
|
private static class |
InMemoryRepository.MemPack |
protected class |
InMemoryRepository.MemRefDatabase
DfsRefDatabase used by InMemoryRepository.
|
private static class |
InMemoryRepository.Out |
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
gitwebDescription |
private InMemoryRepository.MemObjDatabase |
objdb |
(package private) static java.util.concurrent.atomic.AtomicInteger |
packId |
private InMemoryRepository.MemRefDatabase |
refdb |
Constructor and Description |
---|
InMemoryRepository(DfsRepositoryDescription repoDesc)
Initialize a new in-memory repository.
|
InMemoryRepository(InMemoryRepository.Builder builder) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getGitwebDescription()
Read the
GIT_DIR/description file for gitweb. |
InMemoryRepository.MemObjDatabase |
getObjectDatabase()
Get the object database which stores this repository's data.
|
RefDatabase |
getRefDatabase()
Get the reference database which stores the reference namespace.
|
void |
setGitwebDescription(java.lang.String d)
Set the
GIT_DIR/description file for gitweb. |
void |
setPerformsAtomicTransactions(boolean atomic)
Enable (or disable) the atomic reference transaction support.
|
create, createAttributesNodeProvider, exists, getConfig, getDescription, getIdentifier, getReflogReader, notifyIndexChanged, scanForRepoChanges
autoGC, close, create, doClose, exactRef, findRef, fireEvent, getAdditionalHaves, getAllRefs, getAllRefsByPeeledObjectId, getBranch, getDirectory, getFS, getFullBranch, getGlobalListenerList, getIndexFile, getListenerList, getRemoteName, getRemoteNames, getRepositoryState, getTags, getWorkTree, hasObject, incrementOpen, isBare, isValidRefName, lockDirCache, newObjectInserter, newObjectReader, normalizeBranchName, open, open, parseCommit, peel, readCherryPickHead, readCommitEditMsg, readDirCache, readMergeCommitMsg, readMergeHeads, readOrigHead, readRebaseTodo, readRevertHead, readSquashCommitMsg, renameRef, resolve, shortenRefName, shortenRemoteBranchName, simplify, stripWorkDir, toString, updateRef, updateRef, writeCherryPickHead, writeCommitEditMsg, writeMergeCommitMsg, writeMergeHeads, writeOrigHead, writeRebaseTodoFile, writeRevertHead, writeSquashCommitMsg
static final java.util.concurrent.atomic.AtomicInteger packId
private final InMemoryRepository.MemObjDatabase objdb
private final InMemoryRepository.MemRefDatabase refdb
private java.lang.String gitwebDescription
public InMemoryRepository(DfsRepositoryDescription repoDesc)
repoDesc
- description of the repository.InMemoryRepository(InMemoryRepository.Builder builder)
public InMemoryRepository.MemObjDatabase getObjectDatabase()
getObjectDatabase
in class DfsRepository
public RefDatabase getRefDatabase()
getRefDatabase
in class Repository
public void setPerformsAtomicTransactions(boolean atomic)
Useful for testing atomic support enabled or disabled.
atomic
- whether to use atomic reference transaction support@Nullable public java.lang.String getGitwebDescription()
GIT_DIR/description
file for gitweb.getGitwebDescription
in class Repository
public void setGitwebDescription(@Nullable java.lang.String d)
GIT_DIR/description
file for gitweb.setGitwebDescription
in class Repository
d
- new description; null to clear the description.