From 52c18ae15f8fa3787f920e68791367dae2e1af2d Mon Sep 17 00:00:00 2001 From: Ivan Frade Date: Tue, 12 Dec 2023 13:31:03 -0800 Subject: [PATCH] PackWriter/Statistics: Remove the bitmapt hit stats The request uses bitmaps for reachability and to decide what to pack. Setting the listener in the PackWriter only covers the second case. Remove the listener from the PackWriter. It makes more sense to set it in the reader and at the moment the BitmapIndex only supports a single listener. This was introduced after the 6.8 tag, so it should be safe to remove. Change-Id: Ib4c0a805c70e54b6a9e7f78ccdb8e0a465d238f1 --- org.eclipse.jgit/.settings/.api_filters | 8 ------ .../internal/storage/pack/PackWriter.java | 12 --------- .../jgit/storage/pack/PackStatistics.java | 25 ------------------- 3 files changed, 45 deletions(-) diff --git a/org.eclipse.jgit/.settings/.api_filters b/org.eclipse.jgit/.settings/.api_filters index 6b043a801..506a89a00 100644 --- a/org.eclipse.jgit/.settings/.api_filters +++ b/org.eclipse.jgit/.settings/.api_filters @@ -56,12 +56,4 @@ - - - - - - - - diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java index 742759825..9e9523125 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java @@ -68,7 +68,6 @@ import org.eclipse.jgit.lib.BatchingProgressMonitor; import org.eclipse.jgit.lib.BitmapIndex; import org.eclipse.jgit.lib.BitmapIndex.BitmapBuilder; -import org.eclipse.jgit.lib.BitmapIndex.BitmapLookupListener; import org.eclipse.jgit.lib.BitmapObject; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.NullProgressMonitor; @@ -2030,17 +2029,6 @@ private void findObjectsToPack(@NonNull ProgressMonitor countingMonitor, if (!shallowPack && useBitmaps) { BitmapIndex bitmapIndex = reader.getBitmapIndex(); if (bitmapIndex != null) { - bitmapIndex.addBitmapLookupListener(new BitmapLookupListener() { - @Override - public void onBitmapFound(AnyObjectId oid) { - stats.objectsWithBitmapsFound.add(oid); - } - - @Override - public void onBitmapNotFound(AnyObjectId oid) { - // Nothing to do - } - }); BitmapWalker bitmapWalker = new BitmapWalker(walker, bitmapIndex, countingMonitor); findObjectsToPackUsingBitmaps(bitmapWalker, want, have); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackStatistics.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackStatistics.java index 7c8ed2433..64a1eb2e1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackStatistics.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackStatistics.java @@ -48,16 +48,13 @@ import static org.eclipse.jgit.lib.Constants.OBJ_TREE; import java.text.MessageFormat; -import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.internal.storage.pack.CachedPack; -import org.eclipse.jgit.lib.AnyObjectId; import org.eclipse.jgit.lib.ObjectId; /** @@ -235,16 +232,6 @@ public static class Accumulator { /** Commits with no parents. */ public Set rootCommits; - /** - * Set of objects with bitmap hit when finding objects to pack. - * - * The size of this set plus {@link #bitmapIndexMisses} should be the - * walked size of the graph - * - * @since 6.9 - */ - public Set objectsWithBitmapsFound = new HashSet<>(); - /** If a shallow pack, the depth in commits. */ public int depth; @@ -445,18 +432,6 @@ public Set getClientShallowCommits() { return statistics.clientShallowCommits; } - /** - * Get unmodifiable collection of objects walked in the request that had a - * bitmap. - * - * @return ummodifiable collection of objects that had a bitmap attached - * - * @since 6.9 - */ - public Set getObjectsWithBitmapsFound() { - return Collections.unmodifiableSet(statistics.objectsWithBitmapsFound); - } - /** * Get unmodifiable list of the cached packs that were reused in the output *