class PackWriterBitmapPreparer
extends java.lang.Object
PackWriter
to select commits for which to build
pack index bitmaps.Modifier and Type | Class and Description |
---|---|
private static class |
PackWriterBitmapPreparer.BitmapBuilderEntry
A POJO representing a Pair
|
(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 (
peeledWants ), stores them in commitsByOldest , and sets up
bitmaps for each branch tip (tipCommitBitmaps ). |
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<PackWriterBitmapPreparer.BitmapBuilderEntry> |
ORDER_BY_CARDINALITY |
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 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 PackWriterBitmapPreparer.CommitSelectionHelper |
setupTipCommitBitmaps(RevWalk rw,
int expectedCommitCount,
java.util.Set<? extends ObjectId> excludeFromBitmapSelection)
For each of the
want s, which represent the tip commit of each
branch, set up an initial BitmapIndex.BitmapBuilder . |
private static final int DAY_IN_SECONDS
private static final java.util.Comparator<PackWriterBitmapPreparer.BitmapBuilderEntry> ORDER_BY_CARDINALITY
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 setupTipCommitBitmaps(RevWalk rw, int expectedCommitCount, java.util.Set<? extends ObjectId> excludeFromBitmapSelection) throws IncorrectObjectTypeException, java.io.IOException, MissingObjectException
want
s, which represent the tip commit of each
branch, set up an initial BitmapIndex.BitmapBuilder
. Reuse previously built
bitmaps if possible.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
containing bitmaps for the tip
commitsIncorrectObjectTypeException
- 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()