Top Description Fields Constructors Methods
org.eclipse.jgit.internal.storage.dfs

public Class DfsCachedPack

extends CachedPack
Class Inheritance
Imports
java.io.IOException, org.eclipse.jgit.internal.storage.pack.CachedPack, .ObjectToPack, .PackOutputStream, .StoredObjectRepresentation

A DfsPackFile available for reuse as-is.

Field Summary

Modifier and TypeField and Description
private final DfsPackFile

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
public long
getDeltaCount()

Overrides org.eclipse.jgit.internal.storage.pack.CachedPack.getDeltaCount.

Get the number of delta objects stored in this pack.

public long
getObjectCount()

Implements abstract org.eclipse.jgit.internal.storage.pack.CachedPack.getObjectCount.

Get the number of objects in this pack.

public DfsPackDescription

Returns:

the description of the pack.
getPackDescription
()

Get the description of the pack.

public DfsPackFile

Returns:

the pack passed to the constructor
getPackFile
()

Get pack file

public boolean
hasObject(ObjectToPack
the object being packed. Can be used as an ObjectId.
obj
,
StoredObjectRepresentation
representation from the org.eclipse.jgit.internal.storage.pack.ObjectReuseAsIs instance that originally supplied this CachedPack.
rep
)

Implements abstract org.eclipse.jgit.internal.storage.pack.CachedPack.hasObject.

Determine if this pack contains the object representation given.

Field Detail

packback to summary
private final DfsPackFile pack

Constructor Detail

DfsCachedPackback to summary
pack-priv DfsCachedPack(DfsPackFile pack)

Method Detail

copyAsIsback to summary
pack-priv void copyAsIs(PackOutputStream out, DfsReader ctx) throws IOException
getDeltaCountback to summary
public long getDeltaCount() throws IOException

Overrides org.eclipse.jgit.internal.storage.pack.CachedPack.getDeltaCount.

Doc from org.eclipse.jgit.internal.storage.pack.CachedPack.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 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.

Returns:long

the number of deltas; 0 if the number is not known or there are no deltas.

Annotations
@Override
Exceptions
IOException:
if the delta count cannot be read.
getObjectCountback to summary
public long getObjectCount() throws IOException

Implements abstract org.eclipse.jgit.internal.storage.pack.CachedPack.getObjectCount.

Doc from org.eclipse.jgit.internal.storage.pack.CachedPack.getObjectCount.

Get the number of objects in this pack.

Returns:long

the total object count for the pack.

Annotations
@Override
Exceptions
IOException:
if the object count cannot be read.
getPackDescriptionback to summary
public DfsPackDescription getPackDescription()

Get the description of the pack.

Returns:DfsPackDescription

the description of the pack.

getPackFileback to summary
public DfsPackFile getPackFile()

Get pack file

Returns:DfsPackFile

the pack passed to the constructor

hasObjectback to summary
public boolean hasObject(ObjectToPack obj, StoredObjectRepresentation rep)

Implements abstract org.eclipse.jgit.internal.storage.pack.CachedPack.hasObject.

Doc from org.eclipse.jgit.internal.storage.pack.CachedPack.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 of org.eclipse.jgit.internal.storage.pack.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.

Parameters
obj:ObjectToPack

the object being packed. Can be used as an ObjectId.

rep:StoredObjectRepresentation

representation from the org.eclipse.jgit.internal.storage.pack.ObjectReuseAsIs instance that originally supplied this CachedPack.

Returns:boolean

true if this pack contains this object.

Annotations
@Override