aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Frade <ifrade@google.com>2021-12-14 16:24:26 -0800
committerIvan Frade <ifrade@google.com>2022-10-18 11:19:21 -0700
commit60206ea95f1bff6a301ee65e532a27e085812a5d (patch)
tree618d344bd4d539d462f13493140174a10effa385
parentb58ea5c6c90533614600e7ca06fa779532c734bc (diff)
downloadjgit-60206ea95f1bff6a301ee65e532a27e085812a5d.tar.gz
jgit-60206ea95f1bff6a301ee65e532a27e085812a5d.zip
PackedObjectInfo: add the full size to the description
So we can create a size index later. Change-Id: I9db47ced929fbf045fc37bead6449bbf5484d308
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java
index fe1209b6af..bf7997ec62 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java
@@ -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 class PackedObjectInfo extends ObjectIdOwnerMap.Entry {
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;
+ }
}