java.lang.Object
org.eclipse.jgit.internal.storage.dfs.MidxPackList
Helper class to manipulate a list of packs with (maybe) midxs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder to mutate the list of packs. -
Method Summary
Modifier and TypeMethodDescriptionstatic MidxPackListcreate(DfsPackFile... packs) Wrap the packs list into a MidxPackListedit()Get a builder to add/remove packs from the listfindAllCoveringMidxs(List<DfsPackFile> queryPacks) Return all the midxs that cover (directoy or indirectly) a set of packsGet all midx in the list, either top-level or inside other midxsGet all plain packs in the list, either top-level or inside midxsReturn all the plain packs not covered by this midx or its parents.Return the top midx of the chain in the repo
-
Method Details
-
create
Wrap the packs list into a MidxPackListThe input list is well-formed, doesn't have duplicated packs/midxs.
- Parameters:
packs- list of packs (regular or tip midxs)- Returns:
- a MidxPackList instance
-
getAllPlainPacks
Get all plain packs in the list, either top-level or inside midxsInside midx, the packs are in reverse lookup order. This code restores their original order. i.e. the list with packs [INSERT, midx(COMPACT-2, COMPACT-3), midx(GC, COMPACT-1)] becomes [INSERT, COMPACT-3, COMPACT-2, COMPACT-1, GC].
- Returns:
- a list of all "real" packs in this pack list, either top level or inside midxs.
-
getAllMidxPacks
Get all midx in the list, either top-level or inside other midxs- Returns:
- a list of all midxs in thist list, either top level or nested inside other midxs.
-
findAllCoveringMidxs
Return all the midxs that cover (directoy or indirectly) a set of packsIn a chain like midx3(p6, p5) -> midx2(p4, p3) -> midx1(p2, p1), if we check for p3, midx3 and midx2 are covering it and midx1 is not.
- Parameters:
queryPacks- subset of packs we are checking for coverage- Returns:
- set of midxs from the packlist that should also be removed
-
getTopMidxPack
Return the top midx of the chain in the repoIn the unlikely case of multiple unconnected midxs, take the most recent.
- Returns:
- top midx
-
getPlainPacksNotCoveredBy
Return all the plain packs not covered by this midx or its parents.- Parameters:
midx- a multipack index. Null midx returns all packs in db.- Returns:
- all the packs in the db that are not covered by this midx or its parents.
-
edit
Get a builder to add/remove packs from the list- Returns:
- the builder
-