java.lang.Object
org.eclipse.jgit.internal.storage.dfs.DfsPackFile
A Git version 2 pack file representation. A pack file contains Git objects in
delta packed format yielding high compression of lots of object where some
objects are similar.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceLoads the PackBitmapIndex associated with this packfile -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DfsPackFile.PackBitmapIndexLoaderLoader for the default file-basedPackBitmapIndeximplementation.protected ExceptionException that caused the packfile to be flagged as invalid -
Constructor Summary
ConstructorsConstructorDescriptionDfsPackFile(DfsBlockCache cache, DfsPackDescription desc, DfsPackFile.PackBitmapIndexLoader bitmapLoader) Create an instance of DfsPackFile with a custom bitmap loader -
Method Summary
Modifier and TypeMethodDescriptiongetBitmapIndex(DfsReader ctx) Get the BitmapIndex for this PackFile.getCommitGraph(DfsReader ctx) Get the Commit Graph for this PackFile.Get description that was originally used to configure this pack file.getPackIndex(DfsReader ctx) Get the PackIndex for this PackFile.getReverseIdx(DfsReader ctx) Get the PackReverseIndex for this PackFile.booleanhasObject(DfsReader ctx, AnyObjectId id) Check if an object is stored within this pack.booleanWhether the pack index file is loaded and cached in memory.
-
Field Details
-
DEFAULT_BITMAP_LOADER
Loader for the default file-basedPackBitmapIndeximplementation. -
invalidatingCause
Exception that caused the packfile to be flagged as invalid
-
-
Constructor Details
-
DfsPackFile
public DfsPackFile(DfsBlockCache cache, DfsPackDescription desc, DfsPackFile.PackBitmapIndexLoader bitmapLoader) Create an instance of DfsPackFile with a custom bitmap loader- Parameters:
cache- cache that owns the pack datadesc- description of the pack within the DFSbitmapLoader- loader to get the bitmaps of this pack (if any)
-
-
Method Details
-
getPackDescription
Get description that was originally used to configure this pack file.- Returns:
- description that was originally used to configure this pack file.
-
isIndexLoaded
public boolean isIndexLoaded()Whether the pack index file is loaded and cached in memory.- Returns:
- whether the pack index file is loaded and cached in memory.
-
getPackIndex
Get the PackIndex for this PackFile.- Parameters:
ctx- reader context to support reading from the backing store if the index is not already loaded in memory.- Returns:
- the PackIndex.
- Throws:
IOException- the pack index is not available, or is corrupt.
-
getBitmapIndex
Get the BitmapIndex for this PackFile.- Parameters:
ctx- reader context to support reading from the backing store if the index is not already loaded in memory.- Returns:
- the BitmapIndex.
- Throws:
IOException- the bitmap index is not available, or is corrupt.
-
getCommitGraph
Get the Commit Graph for this PackFile.- Parameters:
ctx- reader context to support reading from the backing store if the index is not already loaded in memory.- Returns:
CommitGraph, null if pack doesn't have it.- Throws:
IOException- the Commit Graph is not available, or is corrupt.
-
getReverseIdx
Get the PackReverseIndex for this PackFile.- 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
-
hasObject
Check if an object is stored within this pack.- Parameters:
ctx- reader context to support reading from the backing store if the index is not already loaded in memory.id- object to be located.- Returns:
- true if the object exists in this pack; false if it does not.
- Throws:
IOException- the pack index is not available, or is corrupt.
-