Top Description Inners Fields Constructors Methods
org.eclipse.jgit.internal.storage.dfs

public Class InMemoryRepository

extends DfsRepository
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .FileNotFoundException, .IOException, java.nio.ByteBuffer, java.util.ArrayList, .Collection, .Collections, .List, .Set, java.util.concurrent.atomic.AtomicInteger, org.eclipse.jgit.annotations.Nullable, org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource, org.eclipse.jgit.internal.storage.pack.PackExt, org.eclipse.jgit.internal.storage.reftable.ReftableConfig, org.eclipse.jgit.lib.ObjectId, .RefDatabase

Git repository stored entirely in the local process memory.

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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
InMemoryRepository.Builder

Builder for in-memory repositories.

private static class
public static class
InMemoryRepository.MemObjDatabase

DfsObjDatabase used by InMemoryRepository.

private static class
protected class
InMemoryRepository.MemRefDatabase

DfsRefDatabase used by InMemoryRepository.

private abstract static class

Field Summary

Modifier and TypeField and Description
private String
private final InMemoryRepository.MemObjDatabase
pack-priv static final AtomicInteger
private final InMemoryRepository.MemRefDatabase

Constructor Summary

AccessConstructor and Description
public
InMemoryRepository(DfsRepositoryDescription
description of the repository.
repoDesc
)

Initialize a new in-memory repository.

pack-priv

Method Summary

Modifier and TypeMethod and Description
protected InMemoryRepository.MemRefDatabase

Returns:

a new in-memory reference database.
createRefDatabase
()

Creates a new in-memory ref database.

public String
getGitwebDescription()

Overrides org.eclipse.jgit.lib.Repository.getGitwebDescription.

Read the GIT_DIR/description file for gitweb.

public InMemoryRepository.MemObjDatabase
getObjectDatabase()

Implements abstract org.eclipse.jgit.internal.storage.dfs.DfsRepository.getObjectDatabase.

Get the object database which stores this repository's data.

public RefDatabase
getRefDatabase()

Implements abstract org.eclipse.jgit.lib.Repository.getRefDatabase.

Get the reference database which stores the reference namespace.

public void
setGitwebDescription(String
new description; null to clear the description.
d
)

Overrides org.eclipse.jgit.lib.Repository.setGitwebDescription.

Set the GIT_DIR/description file for gitweb.

public void
setPerformsAtomicTransactions(boolean
whether to use atomic reference transaction support
atomic
)

Enable (or disable) the atomic reference transaction support.

Inherited from org.eclipse.jgit.internal.storage.dfs.DfsRepository:
createcreateAttributesNodeProviderexistsgetConfiggetDescriptiongetIdentifiergetReflogReadernotifyIndexChangedscanForRepoChanges