Class DfsPackFileMidx

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

public final class DfsPackFileMidx extends DfsPackFile
Implementation of a DfsPackfile that tries to solve the queries in a multipack index before resorting to the real packs.

It uses the position in the multipack index of the objects as their "offset".

  • Field Details

    • invalidatingCause

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

    • getPackIndex

      public PackIndex getPackIndex(DfsReader ctx)
      Description copied from class: DfsPackFile
      Get the PackIndex for this PackFile.
      Overrides:
      getPackIndex in class DfsPackFile
      Parameters:
      ctx - reader context to support reading from the backing store if the index is not already loaded in memory.
      Returns:
      the PackIndex.
    • asObjectIdSet

      public ObjectIdSet asObjectIdSet(DfsReader ctx) throws IOException
      Description copied from class: DfsPackFile
      Get a view of this packfile as a set of objects

      To use when the caller only needs to check inclusion (without specific order or getting offsets).

      Overrides:
      asObjectIdSet in class DfsPackFile
      Parameters:
      ctx - reader context
      Returns:
      a view of this packfile as a set of objects
      Throws:
      IOException - cannot load the backing data from storage
    • getReverseIdx

      public PackReverseIndex getReverseIdx(DfsReader ctx)
      Description copied from class: DfsPackFile
      Get the PackReverseIndex for this PackFile.
      Overrides:
      getReverseIdx in class DfsPackFile
      Parameters:
      ctx - reader context to support reading from the backing store if the index is not already loaded in memory
      Returns:
      the PackReverseIndex
    • getBitmapIndex

      public PackBitmapIndex getBitmapIndex(DfsReader ctx) throws IOException
      Description copied from class: DfsPackFile
      Get the BitmapIndex for this PackFile.
      Overrides:
      getBitmapIndex in class DfsPackFile
      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
      Description copied from class: DfsPackFile
      Get the Commit Graph for this PackFile.
      Overrides:
      getCommitGraph in class DfsPackFile
      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.
    • getCoveredPacks

      public List<DfsPackFile> getCoveredPacks()
      Packs indexed by this multipack index (base NOT included)
      Returns:
      packs indexed by this multipack index
    • getAllCoveredPacks

      public List<DfsPackFile> getAllCoveredPacks()
      All packs indexed by this multipack index and its chain

      This does not include the inner multipack indexes themselves, only their covered packs.

      Returns:
      packs indexed by this multipack index and its parents.
    • getMultipackIndexBase

      public DfsPackFileMidx getMultipackIndexBase()
      Base of this multipack index

      If this midx is part of a chain, this is its parent

      Returns:
      the base of this multipack index
    • findIdxPosition

      public int findIdxPosition(DfsReader ctx, AnyObjectId id) throws IOException
      Throws:
      IOException
    • hasObject

      public boolean hasObject(DfsReader ctx, AnyObjectId id) throws IOException
      Description copied from class: DfsPackFile
      Check if an object is stored within this pack.
      Overrides:
      hasObject in class DfsPackFile
      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.