class LocalCachedPack extends CachedPack
Modifier and Type | Field and Description |
---|---|
private ObjectDirectory |
odb |
private java.lang.String[] |
packNames |
private PackFile[] |
packs |
Constructor and Description |
---|
LocalCachedPack(java.util.List<PackFile> packs) |
LocalCachedPack(ObjectDirectory odb,
java.util.List<java.lang.String> packNames) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
copyAsIs(PackOutputStream out,
WindowCursor wc) |
long |
getObjectCount()
Get the number of objects in this pack.
|
private PackFile |
getPackFile(java.lang.String packName) |
private java.lang.String |
getPackFilePath(java.lang.String packName) |
private PackFile[] |
getPacks() |
boolean |
hasObject(ObjectToPack obj,
StoredObjectRepresentation rep)
Determine if this pack contains the object representation given.
|
getDeltaCount
private final ObjectDirectory odb
private final java.lang.String[] packNames
private PackFile[] packs
LocalCachedPack(ObjectDirectory odb, java.util.List<java.lang.String> packNames)
LocalCachedPack(java.util.List<PackFile> packs)
public long getObjectCount() throws java.io.IOException
getObjectCount
in class CachedPack
java.io.IOException
- if the object count cannot be read.void copyAsIs(PackOutputStream out, WindowCursor wc) throws java.io.IOException
java.io.IOException
public boolean hasObject(ObjectToPack obj, StoredObjectRepresentation rep)
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 of
ObjectReuseAsIs.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.
hasObject
in class CachedPack
obj
- the object being packed. Can be used as an ObjectId.rep
- representation from the
ObjectReuseAsIs
instance that originally supplied this CachedPack.private PackFile[] getPacks() throws java.io.FileNotFoundException
java.io.FileNotFoundException
private PackFile getPackFile(java.lang.String packName) throws java.io.FileNotFoundException
java.io.FileNotFoundException
private java.lang.String getPackFilePath(java.lang.String packName)