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 classContainer 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 classA RevFilter that excludes the commits named in a bitmap from the walk. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BitmapIndexImplprivate final PackBitmapIndexRemapperprivate final BitmapIndexImplprivate final intprivate static final intprivate static final intprivate final intprivate final intprivate final longprivate static final Comparator<RevCommit>private final ProgressMonitorprivate final ObjectReaderprivate final intprivate final intprivate 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 thewantscan be found in the previous GC pack's bitmap indices and which are new.private booleanisRecentCommit(RevCommit revCommit) (package private) BitmapWalker(package private) intnextSpan(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 thewantscan be found in the previous GC pack's bitmap indices and which are new.- Parameters:
rw- aRevWalkto 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.CommitSelectionHelpercapturing 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()
-