Class DfsPackFile

java.lang.Object
org.eclipse.jgit.internal.storage.dfs.DfsPackFile

public final class DfsPackFile extends Object
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.
  • Field Details

    • invalidatingCause

      protected volatile Exception invalidatingCause
      Exception that caused the packfile to be flagged as invalid
  • Method Details

    • getPackDescription

      public DfsPackDescription 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

      public PackIndex getPackIndex(DfsReader ctx) throws IOException
      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

      public PackBitmapIndex getBitmapIndex(DfsReader ctx) throws IOException
      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

      public CommitGraph getCommitGraph(DfsReader ctx) throws IOException
      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

      public PackReverseIndex getReverseIdx(DfsReader ctx) throws IOException
      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

      public boolean hasObject(DfsReader ctx, AnyObjectId id) throws IOException
      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.