public static class InMemoryRepository.MemObjDatabase extends DfsObjDatabase
DfsObjDatabase.PackList, DfsObjDatabase.PackSource| Modifier and Type | Method and Description |
|---|---|
protected void |
commitPackImpl(Collection<DfsPackDescription> desc,
Collection<DfsPackDescription> replace)
Implementation of pack commit.
|
protected List<DfsPackDescription> |
listPacks()
List the available pack files.
|
protected DfsPackDescription |
newPack(DfsObjDatabase.PackSource source)
Generate a new unique name for a pack file.
|
protected ReadableChannel |
openFile(DfsPackDescription desc,
PackExt ext)
Open a pack, pack index, or other related file for reading.
|
protected void |
rollbackPack(Collection<DfsPackDescription> desc)
Try to rollback a pack creation.
|
void |
setReadableChannelBlockSizeForTest(int blockSize) |
protected DfsOutputStream |
writeFile(DfsPackDescription desc,
PackExt ext)
Open a pack, pack index, or other related file for writing.
|
clearCache, close, commitPack, getCurrentPackList, getCurrentPacks, getCurrentReftables, getPackList, getPacks, getReaderOptions, getReftables, getRepository, has, newInserter, newPack, newReader, reftableComparator, setPackComparatorcreate, exists, has, newCachedDatabase, open, openpublic void setReadableChannelBlockSizeForTest(int blockSize)
blockSize - force a different block size for testing.protected List<DfsPackDescription> listPacks()
DfsObjDatabaseThe returned list must support random access and must be mutable by the caller. It is sorted in place using the natural sorting of the returned DfsPackDescription objects.
listPacks in class DfsObjDatabaseprotected DfsPackDescription newPack(DfsObjDatabase.PackSource source)
DfsObjDatabasenewPack in class DfsObjDatabasesource - where the pack stream is created.protected void commitPackImpl(Collection<DfsPackDescription> desc, Collection<DfsPackDescription> replace)
DfsObjDatabasecommitPackImpl in class DfsObjDatabasedesc - description of the new packs.replace - if not null, list of packs to remove.DfsObjDatabase.commitPack(Collection, Collection)protected void rollbackPack(Collection<DfsPackDescription> desc)
DfsObjDatabaseJGit DFS always writes the pack first, then the index. If the pack does not yet exist, then neither does the index. A safe DFS implementation would try to remove both files to ensure they are really gone.
A rollback does not support failures, as it only occurs when there is already a failure in progress. A DFS implementor may wish to log warnings/error messages when a rollback fails, but should not send new exceptions up the Java callstack.
rollbackPack in class DfsObjDatabasedesc - pack to delete.protected ReadableChannel openFile(DfsPackDescription desc, PackExt ext) throws FileNotFoundException, IOException
DfsObjDatabaseopenFile in class DfsObjDatabasedesc - description of pack related to the data that will be read.
This is an instance previously obtained from
DfsObjDatabase.listPacks(), but not necessarily from the same
DfsObjDatabase instance.ext - file extension that will be read i.e "pack" or "idx".FileNotFoundException - the file does not exist.IOException - the file cannot be opened.protected DfsOutputStream writeFile(DfsPackDescription desc, PackExt ext) throws IOException
DfsObjDatabasewriteFile in class DfsObjDatabasedesc - description of pack related to the data that will be written.
This is an instance previously obtained from
DfsObjDatabase.newPack(PackSource).ext - file extension that will be written i.e "pack" or "idx".IOException - the file cannot be opened.Copyright © 2018 Eclipse JGit Project. All rights reserved.