Class PackWriterBitmapPreparer
- java.lang.Object
-
- org.eclipse.jgit.internal.storage.pack.PackWriterBitmapPreparer
-
class PackWriterBitmapPreparer extends java.lang.ObjectHelper class for thePackWriterto select commits for which to build pack index bitmaps.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classPackWriterBitmapPreparer.CommitSelectionHelperContainer 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 classPackWriterBitmapPreparer.NotInBitmapFilterA RevFilter that excludes the commits named in a bitmap from the walk.
-
Field Summary
Fields Modifier and Type Field Description private BitmapIndexImplbitmapIndexprivate PackBitmapIndexRemapperbitmapRemapperprivate BitmapIndexImplcommitBitmapIndexprivate intcontiguousCommitCountprivate static intDAY_IN_SECONDSprivate static intDISTANCE_THRESHOLDprivate intdistantCommitSpanprivate intexcessiveBranchCountprivate longinactiveBranchTimestampprivate static java.util.Comparator<RevCommit>ORDER_BY_REVERSE_TIMESTAMPprivate ProgressMonitorpmprivate ObjectReaderreaderprivate intrecentCommitCountprivate intrecentCommitSpanprivate java.util.Set<? extends ObjectId>wantprivate PackBitmapIndexBuilderwriteBitmaps
-
Constructor Summary
Constructors Constructor Description PackWriterBitmapPreparer(ObjectReader reader, PackBitmapIndexBuilder writeBitmaps, ProgressMonitor pm, java.util.Set<? extends ObjectId> want, PackConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private PackWriterBitmapPreparer.CommitSelectionHelpercaptureOldAndNewCommits(RevWalk rw, int expectedCommitCount, java.util.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) BitmapWalkernewBitmapWalker()(package private) intnextSpan(int distanceFromTip)(package private) java.util.Collection<BitmapCommit>selectCommits(int expectedCommitCount, java.util.Set<? extends ObjectId> excludeFromBitmapSelection)Returns the commit objects for which bitmap indices should be built.
-
-
-
Field Detail
-
DAY_IN_SECONDS
private static final int DAY_IN_SECONDS
- See Also:
- Constant Field Values
-
DISTANCE_THRESHOLD
private static final int DISTANCE_THRESHOLD
- See Also:
- Constant Field Values
-
ORDER_BY_REVERSE_TIMESTAMP
private static final java.util.Comparator<RevCommit> ORDER_BY_REVERSE_TIMESTAMP
-
reader
private final ObjectReader reader
-
pm
private final ProgressMonitor pm
-
want
private final java.util.Set<? extends ObjectId> want
-
writeBitmaps
private final PackBitmapIndexBuilder writeBitmaps
-
commitBitmapIndex
private final BitmapIndexImpl commitBitmapIndex
-
bitmapRemapper
private final PackBitmapIndexRemapper bitmapRemapper
-
bitmapIndex
private final BitmapIndexImpl 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 Detail
-
PackWriterBitmapPreparer
PackWriterBitmapPreparer(ObjectReader reader, PackBitmapIndexBuilder writeBitmaps, ProgressMonitor pm, java.util.Set<? extends ObjectId> want, PackConfig config) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
selectCommits
java.util.Collection<BitmapCommit> selectCommits(int expectedCommitCount, java.util.Set<? extends ObjectId> excludeFromBitmapSelection) throws IncorrectObjectTypeException, java.io.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 commitjava.io.IOException- on errors reading pack or index filesMissingObjectException- if an expected object is missing
-
isRecentCommit
private boolean isRecentCommit(RevCommit revCommit)
-
captureOldAndNewCommits
private PackWriterBitmapPreparer.CommitSelectionHelper captureOldAndNewCommits(RevWalk rw, int expectedCommitCount, java.util.Set<? extends ObjectId> excludeFromBitmapSelection) throws IncorrectObjectTypeException, java.io.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 commitjava.io.IOException- on errors reading pack or index filesMissingObjectException- if an expected object is missing
-
nextSpan
int nextSpan(int distanceFromTip)
-
newBitmapWalker
BitmapWalker newBitmapWalker()
-
-