findObjectsToPackUsingBitmaps(bitmapWalker, want, have);
endPhase(countingMonitor);
stats.timeCounting = System.currentTimeMillis() - countingStart;
+ stats.bitmapIndexMisses = bitmapWalker.getCountOfBitmapIndexMisses();
return;
}
}
long totalObjects;
+ long bitmapIndexMisses;
+
long totalDeltas;
long reusedObjects;
return totalObjects;
}
+ /**
+ * @return the count of objects that needed to be discovered through an
+ * object walk because they were not found in bitmap indices.
+ *
+ * @since 4.0
+ */
+ public long getBitmapIndexMisses() {
+ return bitmapIndexMisses;
+ }
+
/**
* @return total number of deltas output. This may be lower than the
* actual number of deltas if a cached pack was reused.
private final ProgressMonitor pm;
+ private long countOfBitmapIndexMisses;
+
PackWriterBitmapWalker(
ObjectWalk walker, BitmapIndex bitmapIndex, ProgressMonitor pm) {
this.walker = walker;
this.pm = (pm == null) ? NullProgressMonitor.INSTANCE : pm;
}
+ long getCountOfBitmapIndexMisses() {
+ return countOfBitmapIndexMisses;
+ }
+
BitmapBuilder findObjects(Set<? extends ObjectId> start, BitmapBuilder seen, boolean ignoreMissingStart)
throws MissingObjectException, IncorrectObjectTypeException,
IOException {
}
if (marked) {
- walker.setRevFilter(newRevFilter(seen, bitmapResult));
+ BitmapRevFilter filter = newRevFilter(seen, bitmapResult);
+ walker.setRevFilter(filter);
while (walker.next() != null) {
// Iterate through all of the commits. The BitmapRevFilter does
bitmapResult.add(ro, ro.getType());
pm.update(1);
}
+ countOfBitmapIndexMisses += filter.getCountOfLoadedCommits();
}
return bitmapResult;
walker.reset();
}
- static RevFilter newRevFilter(
+ static BitmapRevFilter newRevFilter(
final BitmapBuilder seen, final BitmapBuilder bitmapResult) {
if (seen != null) {
return new BitmapRevFilter() {
}
static abstract class BitmapRevFilter extends RevFilter {
+ private long countOfLoadedCommits;
+
protected abstract boolean load(RevCommit cmit);
@Override
public final boolean include(RevWalk walker, RevCommit cmit) {
- if (load(cmit))
+ if (load(cmit)) {
+ countOfLoadedCommits++;
return true;
+ }
for (RevCommit p : cmit.getParents())
p.add(RevFlag.SEEN);
return false;
public final boolean requiresCommitBody() {
return false;
}
+
+ long getCountOfLoadedCommits() {
+ return countOfLoadedCommits;
+ }
}
}