java.lang.Object
org.eclipse.jgit.internal.storage.dfs.DfsPackFile
org.eclipse.jgit.internal.storage.dfs.DfsPackFileMidx
- Direct Known Subclasses:
DfsPackFileMidxNPacks,DfsPackFileMidxSingle
public abstract sealed class DfsPackFileMidx
extends DfsPackFile
permits DfsPackFileMidxNPacks, DfsPackFileMidxSingle
DfsPackFile with the extra methods to support midx.
This is an abstract class to keep the inheritance from DfsPackFile and allow a dummy implementation for single packs.
We implement at this level methods that just translate midx to pack offsets and forward to the pack.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classData object that keeps a location readable as midx-offset or as (pack/offset).protected static interfaceTranslates from midx-offset (considering all packs concatenated in midx order) to (pack, offset) pair.Nested classes/interfaces inherited from class org.eclipse.jgit.internal.storage.dfs.DfsPackFile
DfsPackFile.CachedStreamIndexFactory, DfsPackFile.CachedStreamPackIndexes, DfsPackFile.IndexFactory, DfsPackFile.PackBitmapIndexLoader -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ExceptionException that caused the packfile to be flagged as invalidFields inherited from class org.eclipse.jgit.internal.storage.dfs.DfsPackFile
DEFAULT_BITMAP_LOADER, OFFSET_SORT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDfsPackFileMidx(DfsBlockCache cache, DfsPackDescription desc) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic DfsPackFileMidxcreate(DfsBlockCache cache, DfsPackDescription desc, List<DfsPackFile> requiredPacks, DfsPackFileMidx base) Create a midx packAll packs indexed by this multipack index and its chainprotected abstract byte[]getChecksum(DfsReader ctx) Return checksum of the midxabstract List<DfsPackFile>Packs indexed by this multipack index (base NOT included) in midx order.abstract DfsPackFileMidxBase of this multipack indexprotected intgetObjectCount(DfsReader ctx) Count of objects in this pack (i.e. including, recursively, its base)protected abstract DfsPackFileMidx.VOffsetCalculatorGet the object calculator of this midxfinal PackIndexgetPackIndex(DfsReader ctx) Get the PackIndex for this PackFile.abstract PackReverseIndexgetReverseIdx(DfsReader ctx) Get the PackReverseIndex for this PackFile.protected abstract MultiPackIndex.MidxIteratorlocalIterator(DfsReader ctx) Get a midx iterator over the contents of *this* midx, without the base.Methods inherited from class org.eclipse.jgit.internal.storage.dfs.DfsPackFile
asObjectIdSet, getBitmapIndex, getCommitGraph, getPackDescription, hasObject, isIndexLoaded
-
Field Details
-
invalidatingCause
Exception that caused the packfile to be flagged as invalid
-
-
Constructor Details
-
DfsPackFileMidx
Default constructor- Parameters:
cache- dfs block cachedesc- midx pack description
-
-
Method Details
-
create
public static DfsPackFileMidx create(DfsBlockCache cache, DfsPackDescription desc, List<DfsPackFile> requiredPacks, @Nullable DfsPackFileMidx base) Create a midx pack- Parameters:
cache- dfs block cachedesc- description of the pack, covering at least one other packrequiredPacks- DfsPackFile instances of the covered packsbase- midx acting a base of this- Returns:
- a midx pack
-
getMultipackIndexBase
Base of this multipack indexIf this midx is part of a chain, this is its parent
- Returns:
- the base of this multipack index
-
getCoveredPacks
Packs indexed by this multipack index (base NOT included) in midx order.- Returns:
- packs indexed by this multipack index in the order used inside the midx.
-
getAllCoveredPacks
All packs indexed by this multipack index and its chainThis does not include the inner multipack indexes themselves, only their covered packs.
- Returns:
- packs indexed by this multipack index and its parents.
-
getObjectCount
Count of objects in this pack (i.e. including, recursively, its base)- Parameters:
ctx- a reader- Returns:
- count of objects in this pack, including its bases
- Throws:
IOException- an error reading a midx in the chain
-
getChecksum
Return checksum of the midx- Parameters:
ctx- a reader- Returns:
- checksum of the midx
- Throws:
IOException- an error reading the file
-
localIterator
Get a midx iterator over the contents of *this* midx, without the base.- Parameters:
ctx- a ready- Returns:
- an iterator over the objects in this midx in sha1 order
- Throws:
IOException- an error loading the underlying data
-
getPackIndex
Description copied from class:DfsPackFileGet the PackIndex for this PackFile.- Overrides:
getPackIndexin classDfsPackFile- Parameters:
ctx- reader context to support reading from the backing store if the index is not already loaded in memory.- Returns:
- the PackIndex.
-
getReverseIdx
Description copied from class:DfsPackFileGet the PackReverseIndex for this PackFile.- Overrides:
getReverseIdxin classDfsPackFile- Parameters:
ctx- reader context to support reading from the backing store if the index is not already loaded in memory- Returns:
- the PackReverseIndex
- Throws:
IOException- the pack index is not available, or is corrupt
-
getOffsetCalculator
Get the object calculator of this midx- Returns:
- an offset calculator for this midx (including its chain)
-