class PackWriterBitmapPreparer
extends java.lang.Object
PackWriter
to select commits for which to build
pack index bitmaps.Modifier and Type | Class and Description |
---|---|
(package private) static class |
PackWriterBitmapPreparer.BitmapCommit
A commit object for which a bitmap index should be built.
|
private static class |
PackWriterBitmapPreparer.CommitSelectionHelper
Container for state used in the first phase of selecting commits, which
walks all of the reachable commits via the branch tips that are not
covered by a previous pack's bitmaps (
newWants ) and stores them
in newCommitsByOldest . |
private static class |
PackWriterBitmapPreparer.NotInBitmapFilter
A RevFilter that excludes the commits named in a bitmap from the walk.
|
Modifier and Type | Field and Description |
---|---|
private BitmapIndexImpl |
bitmapIndex |
private PackBitmapIndexRemapper |
bitmapRemapper |
private BitmapIndexImpl |
commitBitmapIndex |
private int |
contiguousCommitCount |
private static int |
DAY_IN_SECONDS |
private int |
distantCommitSpan |
private int |
excessiveBranchCount |
private long |
inactiveBranchTimestamp |
private static java.util.Comparator<RevCommit> |
ORDER_BY_REVERSE_TIMESTAMP |
private ProgressMonitor |
pm |
private ObjectReader |
reader |
private int |
recentCommitCount |
private int |
recentCommitSpan |
private java.util.Set<? extends ObjectId> |
want |
private PackBitmapIndexBuilder |
writeBitmaps |
Constructor and Description |
---|
PackWriterBitmapPreparer(ObjectReader reader,
PackBitmapIndexBuilder writeBitmaps,
ProgressMonitor pm,
java.util.Set<? extends ObjectId> want,
PackConfig config) |
Modifier and Type | Method and Description |
---|---|
private PackWriterBitmapPreparer.CommitSelectionHelper |
captureOldAndNewCommits(RevWalk rw,
int expectedCommitCount,
java.util.Set<? extends ObjectId> excludeFromBitmapSelection)
Records which of the
wants can be found in the previous GC pack's
bitmap indices and which are new. |
private boolean |
isRecentCommit(RevCommit revCommit) |
(package private) BitmapWalker |
newBitmapWalker() |
(package private) int |
nextSpan(int distanceFromTip) |
(package private) java.util.Collection<PackWriterBitmapPreparer.BitmapCommit> |
selectCommits(int expectedCommitCount,
java.util.Set<? extends ObjectId> excludeFromBitmapSelection)
Returns the commit objects for which bitmap indices should be built.
|
private static final int DAY_IN_SECONDS
private static final java.util.Comparator<RevCommit> ORDER_BY_REVERSE_TIMESTAMP
private final ObjectReader reader
private final ProgressMonitor pm
private final java.util.Set<? extends ObjectId> want
private final PackBitmapIndexBuilder writeBitmaps
private final BitmapIndexImpl commitBitmapIndex
private final PackBitmapIndexRemapper bitmapRemapper
private final BitmapIndexImpl bitmapIndex
private final int contiguousCommitCount
private final int recentCommitCount
private final int recentCommitSpan
private final int distantCommitSpan
private final int excessiveBranchCount
private final long inactiveBranchTimestamp
PackWriterBitmapPreparer(ObjectReader reader, PackBitmapIndexBuilder writeBitmaps, ProgressMonitor pm, java.util.Set<? extends ObjectId> want, PackConfig config) throws java.io.IOException
java.io.IOException
java.util.Collection<PackWriterBitmapPreparer.BitmapCommit> selectCommits(int expectedCommitCount, java.util.Set<? extends ObjectId> excludeFromBitmapSelection) throws IncorrectObjectTypeException, java.io.IOException, MissingObjectException
expectedCommitCount
- count of commits in the packexcludeFromBitmapSelection
- commits that should be excluded from bitmap selectionIncorrectObjectTypeException
- if any of the processed objects is not a commitjava.io.IOException
- on errors reading pack or index filesMissingObjectException
- if an expected object is missingprivate boolean isRecentCommit(RevCommit revCommit)
private PackWriterBitmapPreparer.CommitSelectionHelper captureOldAndNewCommits(RevWalk rw, int expectedCommitCount, java.util.Set<? extends ObjectId> excludeFromBitmapSelection) throws IncorrectObjectTypeException, java.io.IOException, MissingObjectException
wants
can be found in the previous GC pack's
bitmap indices and which are new.rw
- a RevWalk
to find reachable objects in this repositoryexpectedCommitCount
- expected count of commits. The actual count may be less due to
unreachable garbage.excludeFromBitmapSelection
- commits that should be excluded from bitmap selectionPackWriterBitmapPreparer.CommitSelectionHelper
capturing which commits are
covered by a previous pack's bitmaps and which new commits need
bitmap coverageIncorrectObjectTypeException
- if any of the processed objects is not a commitjava.io.IOException
- on errors reading pack or index filesMissingObjectException
- if an expected object is missingint nextSpan(int distanceFromTip)
BitmapWalker newBitmapWalker()