PackedObjectInfo: add the full size to the description

So we can create a size index later.

Change-Id: I9db47ced929fbf045fc37bead6449bbf5484d308
This commit is contained in:
Ivan Frade 2021-12-14 16:24:26 -08:00
parent b58ea5c6c9
commit 60206ea95f
1 changed files with 36 additions and 0 deletions

View File

@ -31,6 +31,8 @@ public class PackedObjectInfo extends ObjectIdOwnerMap.Entry {
private long sizeBeforeInflating;
private long fullSize;
PackedObjectInfo(final long headerOffset, final int packedCRC,
final AnyObjectId id) {
super(id);
@ -111,11 +113,45 @@ public void setType(int type) {
this.type = type;
}
/**
* Size in storage
*
* @param sizeBeforeInflating
*/
void setSize(long sizeBeforeInflating) {
this.sizeBeforeInflating = sizeBeforeInflating;
}
/**
* Size in storage (maybe deflated and/or deltified).
*
* This is the size in storage. In packs, this is the bytes used by the
* object contents (themselves or as deltas) compressed by zlib (deflated).
*
* @return size in storage
*/
long getSize() {
return sizeBeforeInflating;
}
/**
* Real (materialized) size of the object (inflated, undeltified)
*
* @param size
* size of the object in bytes, without compressing nor
* deltifying
* @since 6.4
*/
public void setFullSize(long size) {
this.fullSize = size;
}
/**
* @return size of the object (inflated, undeltified)
*
* @since 6.4
*/
public long getFullSize() {
return fullSize;
}
}