Class DfsCachedPack
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidcopyAsIs(PackOutputStream out, DfsReader ctx) longGet the number of delta objects stored in this pack.longGet the number of objects in this pack.Get the description of the pack.booleanhasObject(ObjectToPack obj, StoredObjectRepresentation rep) Determine if this pack contains the object representation given.
-
Field Details
-
pack
-
-
Constructor Details
-
DfsCachedPack
DfsCachedPack(DfsPackFile pack)
-
-
Method Details
-
getPackFile
- Returns:
- the pack passed to the constructor
-
getPackDescription
Get the description of the pack.- Returns:
- the description of the pack.
-
getObjectCount
Get the number of objects in this pack.- Specified by:
getObjectCountin classCachedPack- Returns:
- the total object count for the pack.
- Throws:
IOException- if the object count cannot be read.
-
getDeltaCount
Get the number of delta objects stored in this pack.This is an optional method, not every cached pack storage system knows the precise number of deltas stored within the pack. This number must be smaller than
CachedPack.getObjectCount()as deltas are not supposed to span across pack files.This method must be fast, if the only way to determine delta counts is to scan the pack file's contents one object at a time, implementors should return 0 and avoid the high cost of the scan.
- Overrides:
getDeltaCountin classCachedPack- Returns:
- the number of deltas; 0 if the number is not known or there are no deltas.
- Throws:
IOException- if the delta count cannot be read.
-
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
reponly 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:
hasObjectin classCachedPack- Parameters:
obj- the object being packed. Can be used as an ObjectId.rep- representation from theObjectReuseAsIsinstance that originally supplied this CachedPack.- Returns:
- true if this pack contains this object.
-
copyAsIs
- Throws:
IOException
-