Class PackWriterBitmapPreparer
java.lang.Object
org.eclipse.jgit.internal.storage.pack.PackWriterBitmapPreparer
Helper class for the
PackWriter
to select commits for which to build
pack index bitmaps.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
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 innewCommitsByOldest
.private static class
A RevFilter that excludes the commits named in a bitmap from the walk. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BitmapIndexImpl
private final PackBitmapIndexRemapper
private final BitmapIndexImpl
private final int
private static final int
private static final int
private final int
private final int
private final long
private static final Comparator
<RevCommit> private final ProgressMonitor
private final ObjectReader
private final int
private final int
private final PackBitmapIndexBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionPackWriterBitmapPreparer
(ObjectReader reader, PackBitmapIndexBuilder writeBitmaps, ProgressMonitor pm, Set<? extends ObjectId> want, PackConfig config) -
Method Summary
Modifier and TypeMethodDescriptioncaptureOldAndNewCommits
(RevWalk rw, int expectedCommitCount, Set<? extends ObjectId> excludeFromBitmapSelection) Records which of thewants
can be found in the previous GC pack's bitmap indices and which are new.private boolean
isRecentCommit
(RevCommit revCommit) (package private) BitmapWalker
(package private) int
nextSpan
(int distanceFromTip) (package private) Collection
<BitmapCommit> selectCommits
(int expectedCommitCount, Set<? extends ObjectId> excludeFromBitmapSelection) Returns the commit objects for which bitmap indices should be built.
-
Field Details
-
DAY_IN_SECONDS
private static final int DAY_IN_SECONDS- See Also:
-
DISTANCE_THRESHOLD
private static final int DISTANCE_THRESHOLD- See Also:
-
ORDER_BY_REVERSE_TIMESTAMP
-
reader
-
pm
-
want
-
writeBitmaps
-
commitBitmapIndex
-
bitmapRemapper
-
bitmapIndex
-
contiguousCommitCount
private final int contiguousCommitCount -
recentCommitCount
private final int recentCommitCount -
recentCommitSpan
private final int recentCommitSpan -
distantCommitSpan
private final int distantCommitSpan -
excessiveBranchCount
private final int excessiveBranchCount -
inactiveBranchTimestamp
private final long inactiveBranchTimestamp
-
-
Constructor Details
-
PackWriterBitmapPreparer
PackWriterBitmapPreparer(ObjectReader reader, PackBitmapIndexBuilder writeBitmaps, ProgressMonitor pm, Set<? extends ObjectId> want, PackConfig config) throws IOException - Throws:
IOException
-
-
Method Details
-
selectCommits
Collection<BitmapCommit> selectCommits(int expectedCommitCount, Set<? extends ObjectId> excludeFromBitmapSelection) throws IncorrectObjectTypeException, IOException, MissingObjectException Returns the commit objects for which bitmap indices should be built.- Parameters:
expectedCommitCount
- count of commits in the packexcludeFromBitmapSelection
- commits that should be excluded from bitmap selection- Returns:
- commit objects for which bitmap indices should be built
- Throws:
IncorrectObjectTypeException
- if any of the processed objects is not a commitIOException
- on errors reading pack or index filesMissingObjectException
- if an expected object is missing
-
isRecentCommit
-
captureOldAndNewCommits
private PackWriterBitmapPreparer.CommitSelectionHelper captureOldAndNewCommits(RevWalk rw, int expectedCommitCount, Set<? extends ObjectId> excludeFromBitmapSelection) throws IncorrectObjectTypeException, IOException, MissingObjectException Records which of thewants
can be found in the previous GC pack's bitmap indices and which are new.- Parameters:
rw
- aRevWalk
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 selection- Returns:
- a
PackWriterBitmapPreparer.CommitSelectionHelper
capturing which commits are covered by a previous pack's bitmaps and which new commits need bitmap coverage - Throws:
IncorrectObjectTypeException
- if any of the processed objects is not a commitIOException
- on errors reading pack or index filesMissingObjectException
- if an expected object is missing
-
nextSpan
int nextSpan(int distanceFromTip) -
newBitmapWalker
BitmapWalker newBitmapWalker()
-