Class LocalCachedPack
java.lang.Object
org.eclipse.jgit.internal.storage.pack.CachedPack
org.eclipse.jgit.internal.storage.file.LocalCachedPack
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLocalCachedPack
(List<Pack> packs) LocalCachedPack
(ObjectDirectory odb, List<String> packNames) -
Method Summary
Modifier and TypeMethodDescription(package private) void
copyAsIs
(PackOutputStream out, WindowCursor wc) long
Get the number of objects in this pack.private Pack
getPackFile
(String packName) private String
getPackFilePath
(String packName) private Pack[]
getPacks()
boolean
hasObject
(ObjectToPack obj, StoredObjectRepresentation rep) Determine if this pack contains the object representation given.Methods inherited from class org.eclipse.jgit.internal.storage.pack.CachedPack
getDeltaCount
-
Field Details
-
odb
-
packNames
-
packs
-
-
Constructor Details
-
LocalCachedPack
LocalCachedPack(ObjectDirectory odb, List<String> packNames) -
LocalCachedPack
-
-
Method Details
-
getObjectCount
Get the number of objects in this pack.- Specified by:
getObjectCount
in classCachedPack
- Returns:
- the total object count for the pack.
- Throws:
IOException
- if the object count cannot be read.
-
copyAsIs
- Throws:
IOException
-
hasObject
Determine if this pack contains the object representation given.PackWriter uses this method during the finding sources phase to prune away any objects from the leading thin-pack that already appear within this pack and should not be sent twice.
Implementors are strongly encouraged to rely on looking at
rep
only and using its internal state to decide if this object is within this pack. Implementors should ensure a representation from this cached pack is tested as part ofObjectReuseAsIs.selectObjectRepresentation(PackWriter, org.eclipse.jgit.lib.ProgressMonitor, Iterable)
, ensuring this method would eventually return true if the object would be included by this cached pack.- Specified by:
hasObject
in classCachedPack
- Parameters:
obj
- the object being packed. Can be used as an ObjectId.rep
- representation from theObjectReuseAsIs
instance that originally supplied this CachedPack.- Returns:
- true if this pack contains this object.
-
getPacks
- Throws:
FileNotFoundException
-
getPackFile
- Throws:
FileNotFoundException
-
getPackFilePath
-