Skip to content

Commit

Permalink
Merge "PackBitmapIndexBuilder.StoredEntry: add getter for objectId"
Browse files Browse the repository at this point in the history
  • Loading branch information
ifradeo authored and gerritforge-ltd committed Apr 12, 2024
2 parents b6ff6ea + 1790ff5 commit 5c1c006
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ private StoredEntry generateStoredEntry(StoredBitmap bitmapToWrite) {
throw new IllegalStateException();
}
bestBitmap.trim();
StoredEntry result = new StoredEntry(entry.idxPosition, bestBitmap,
bestXorOffset, bitmapToWrite.getFlags());
StoredEntry result = new StoredEntry(entry, entry.idxPosition,
bestBitmap, bestXorOffset, bitmapToWrite.getFlags());

return result;
}
Expand Down Expand Up @@ -330,6 +330,8 @@ public List<StoredEntry> getCompressedBitmaps() {

/** Data object for the on disk representation of a bitmap entry. */
public static final class StoredEntry {
private final ObjectId objectId;

private final long idxPosition;

private final EWAHCompressedBitmap bitmap;
Expand All @@ -341,6 +343,8 @@ public static final class StoredEntry {
/**
* Create a StoredEntry
*
* @param objectId
* objectId of the object associated with the bitmap
* @param idxPosition
* position of this object into the pack index (i.e. sorted
* by sha1)
Expand All @@ -353,8 +357,9 @@ public static final class StoredEntry {
* @param flags
* flags for this bitmap
*/
public StoredEntry(long idxPosition, EWAHCompressedBitmap bitmap,
int xorOffset, int flags) {
public StoredEntry(ObjectId objectId, long idxPosition,
EWAHCompressedBitmap bitmap, int xorOffset, int flags) {
this.objectId = objectId;
this.idxPosition = idxPosition;
this.bitmap = bitmap;
this.xorOffset = xorOffset;
Expand Down Expand Up @@ -395,6 +400,13 @@ public int getFlags() {
public long getIdxPosition() {
return idxPosition;
}

/**
* @return the objectId of the object associated with this bitmap
*/
public ObjectId getObjectId() {
return objectId;
}
}

private static final class PositionEntry extends ObjectIdOwnerMap.Entry {
Expand Down

0 comments on commit 5c1c006

Please sign in to comment.