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
This commit is contained in:
parent
a2fed42939
commit
52c18ae15f
|
@ -56,12 +56,4 @@
|
||||||
</message_arguments>
|
</message_arguments>
|
||||||
</filter>
|
</filter>
|
||||||
</resource>
|
</resource>
|
||||||
<resource path="src/org/eclipse/jgit/storage/pack/PackStatistics.java" type="org.eclipse.jgit.storage.pack.PackStatistics$Accumulator">
|
|
||||||
<filter id="336658481">
|
|
||||||
<message_arguments>
|
|
||||||
<message_argument value="org.eclipse.jgit.storage.pack.PackStatistics.Accumulator"/>
|
|
||||||
<message_argument value="objectsWithBitmapsFound"/>
|
|
||||||
</message_arguments>
|
|
||||||
</filter>
|
|
||||||
</resource>
|
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -68,7 +68,6 @@
|
||||||
import org.eclipse.jgit.lib.BatchingProgressMonitor;
|
import org.eclipse.jgit.lib.BatchingProgressMonitor;
|
||||||
import org.eclipse.jgit.lib.BitmapIndex;
|
import org.eclipse.jgit.lib.BitmapIndex;
|
||||||
import org.eclipse.jgit.lib.BitmapIndex.BitmapBuilder;
|
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.BitmapObject;
|
||||||
import org.eclipse.jgit.lib.Constants;
|
import org.eclipse.jgit.lib.Constants;
|
||||||
import org.eclipse.jgit.lib.NullProgressMonitor;
|
import org.eclipse.jgit.lib.NullProgressMonitor;
|
||||||
|
@ -2030,17 +2029,6 @@ private void findObjectsToPack(@NonNull ProgressMonitor countingMonitor,
|
||||||
if (!shallowPack && useBitmaps) {
|
if (!shallowPack && useBitmaps) {
|
||||||
BitmapIndex bitmapIndex = reader.getBitmapIndex();
|
BitmapIndex bitmapIndex = reader.getBitmapIndex();
|
||||||
if (bitmapIndex != null) {
|
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,
|
BitmapWalker bitmapWalker = new BitmapWalker(walker,
|
||||||
bitmapIndex, countingMonitor);
|
bitmapIndex, countingMonitor);
|
||||||
findObjectsToPackUsingBitmaps(bitmapWalker, want, have);
|
findObjectsToPackUsingBitmaps(bitmapWalker, want, have);
|
||||||
|
|
|
@ -48,16 +48,13 @@
|
||||||
import static org.eclipse.jgit.lib.Constants.OBJ_TREE;
|
import static org.eclipse.jgit.lib.Constants.OBJ_TREE;
|
||||||
|
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.eclipse.jgit.internal.JGitText;
|
import org.eclipse.jgit.internal.JGitText;
|
||||||
import org.eclipse.jgit.internal.storage.pack.CachedPack;
|
import org.eclipse.jgit.internal.storage.pack.CachedPack;
|
||||||
import org.eclipse.jgit.lib.AnyObjectId;
|
|
||||||
import org.eclipse.jgit.lib.ObjectId;
|
import org.eclipse.jgit.lib.ObjectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -235,16 +232,6 @@ public static class Accumulator {
|
||||||
/** Commits with no parents. */
|
/** Commits with no parents. */
|
||||||
public Set<ObjectId> rootCommits;
|
public Set<ObjectId> 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<AnyObjectId> objectsWithBitmapsFound = new HashSet<>();
|
|
||||||
|
|
||||||
/** If a shallow pack, the depth in commits. */
|
/** If a shallow pack, the depth in commits. */
|
||||||
public int depth;
|
public int depth;
|
||||||
|
|
||||||
|
@ -445,18 +432,6 @@ public Set<ObjectId> getClientShallowCommits() {
|
||||||
return statistics.clientShallowCommits;
|
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<AnyObjectId> getObjectsWithBitmapsFound() {
|
|
||||||
return Collections.unmodifiableSet(statistics.objectsWithBitmapsFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get unmodifiable list of the cached packs that were reused in the output
|
* Get unmodifiable list of the cached packs that were reused in the output
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue