| Modifier and Type | Field and Description |
|---|---|
| private Set | |
| private Set | |
| private long | |
| private boolean | |
| private DfsReader | |
| private List | |
| private long | |
| private boolean | |
| private final List | |
| private final List | |
| private final List | |
| private Set | |
| private final DfsObjDatabase | |
| private PackConfig | |
| private List | |
| private final RefDatabase | |
| private Instant | |
| private Collection | |
| private ReftableConfig | |
| private long | |
| private long | |
| private List | |
| private final DfsRepository | |
| private Instant | |
| private Set | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | DfsGarbageCollector(DfsRepository
repository objects to be packed will be read from. repository)Initialize a garbage collector. |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | |
| private static long | |
| private long | |
| private Collection | |
| public long | Returns: coalesce garbage limit, packs smaller than this size will be repacked.Get coalesce garbage limit |
| public long | Returns: garbage packs older than this limit (in milliseconds) will be pruned as part of the garbage collection process if the value is > 0, otherwise garbage packs are retained.Get time to live for garbage packs. |
| public List | Returns: new packs created by this compaction.Get new packs created by this compaction. |
| public List | Returns: statistics corresponding to thegetNewPacks().Get statistics corresponding to the |
| public PackConfig | Returns: configuration used to generate the new pack file.Get configuration used to generate the new pack file. |
| public Set | Returns: all of the source packs that fed into this compaction.Get all of the source packs that fed into this compaction. |
| private boolean | |
| private static boolean | |
| private static boolean | |
| private PackWriter | |
| private int | |
| public boolean | Returns: true if the repack was successful without race conditions. False if a race condition was detected and the repack should be run again later.progress monitor to receive updates on as packing may take a
while, depending on the size of the repository. pm)Create a single new pack file containing all of the live objects. |
| private void | |
| private void | |
| private boolean | |
| private boolean | |
| private void | |
| private void | |
| private void | |
| public DfsGarbageCollector | Returns: thissize in bytes. limit)Set the byte size limit for garbage packs to be repacked. |
| public DfsGarbageCollector | Returns: thisif convert)true, setReftableConfig(ReftableConfig)
has been set non-null, and a GC reftable doesn't yet exist,
the garbage collector will make one by scanning the existing
references, and writing a new reftable. Default is
true.Whether the garbage collector should convert references to reftable. |
| public DfsGarbageCollector | Returns: thisTime to live whatever unit is specified. ttl, TimeUnit The specified time unit. unit)Set the time to live for garbage objects. |
| public DfsGarbageCollector | Returns: thisif include)true, the garbage collector will include tombstones
for deleted references in the reftable. Default is
false.Whether the garbage collector will include tombstones for deleted references in the reftable. |
| public DfsGarbageCollector | Returns: thisthe new configuration to use when creating the pack file. newConfig)Set the new configuration to use when creating the pack file. |
| public DfsGarbageCollector | Returns: thisinstant in time which defines refLog expiration refLogExpire)Set time limit to the reflog history. |
| public DfsGarbageCollector | Returns: thisconfiguration to write a reftable. Reftable writing is
disabled (default) when cfg)cfg is null.Set configuration to write a reftable. |
| public DfsGarbageCollector | Returns: thismaxUpdateIndex for the initial reftable created by scanning
u)org..
Ignored unless caller has also set
setReftableConfig(ReftableConfig). Defaults to
1. Must be u >= 0.Set maxUpdateIndex for the initial reftable created during conversion. |
| public DfsGarbageCollector | Returns: thisminUpdateIndex for the initial reftable created by scanning
u)org..
Ignored unless caller has also set
setReftableConfig(ReftableConfig). Defaults to
1. Must be u >= 0.Set minUpdateIndex for the initial reftable created during conversion. |
| public DfsGarbageCollector | Returns: thisWhether bloom filter generation is enabled enable)Toggle bloom filter generation. |
| public DfsGarbageCollector | Returns: thisAllow/Disallow commit graph generation. enable)Toggle commit graph generation. |
| private Set | |
| private void | |
| private DfsPackDescription | writePack(DfsObjDatabase.
|
| private void | |
| private void | |
| private void |
| allHeadsAndTags | back to summary |
|---|---|
| private Set<ObjectId> allHeadsAndTags | |
| allTags | back to summary |
|---|---|
| private Set<ObjectId> allTags | |
| coalesceGarbageLimit | back to summary |
|---|---|
| private long coalesceGarbageLimit | |
| convertToReftable | back to summary |
|---|---|
| private boolean convertToReftable | |
| ctx | back to summary |
|---|---|
| private DfsReader ctx | |
| expiredGarbagePacks | back to summary |
|---|---|
| private List<DfsPackFile> expiredGarbagePacks | |
| garbageTtlMillis | back to summary |
|---|---|
| private long garbageTtlMillis | |
| includeDeletes | back to summary |
|---|---|
| private boolean includeDeletes | |
| newPackDesc | back to summary |
|---|---|
| private final List<DfsPackDescription> newPackDesc | |
| newPackObj | back to summary |
|---|---|
| private final List<ObjectIdSet> newPackObj | |
| newPackStats | back to summary |
|---|---|
| private final List<PackStatistics> newPackStats | |
| nonHeads | back to summary |
|---|---|
| private Set<ObjectId> nonHeads | |
| objdb | back to summary |
|---|---|
| private final DfsObjDatabase objdb | |
| packConfig | back to summary |
|---|---|
| private PackConfig packConfig | |
| packsBefore | back to summary |
|---|---|
| private List<DfsPackFile> packsBefore | |
| refdb | back to summary |
|---|---|
| private final RefDatabase refdb | |
| refLogExpire | back to summary |
|---|---|
| private Instant refLogExpire | |
| refsBefore | back to summary |
|---|---|
| private Collection<Ref> refsBefore | |
| reftableConfig | back to summary |
|---|---|
| private ReftableConfig reftableConfig | |
| reftableInitialMaxUpdateIndex | back to summary |
|---|---|
| private long reftableInitialMaxUpdateIndex | |
| reftableInitialMinUpdateIndex | back to summary |
|---|---|
| private long reftableInitialMinUpdateIndex | |
| reftablesBefore | back to summary |
|---|---|
| private List<DfsReftable> reftablesBefore | |
| repo | back to summary |
|---|---|
| private final DfsRepository repo | |
| startTime | back to summary |
|---|---|
| private Instant startTime | |
| tagTargets | back to summary |
|---|---|
| private Set<ObjectId> tagTargets | |
| writeBloomFilter | back to summary |
|---|---|
| private boolean writeBloomFilter | |
| writeCommitGraph | back to summary |
|---|---|
| private boolean writeCommitGraph | |
| DfsGarbageCollector | back to summary |
|---|---|
| public DfsGarbageCollector(DfsRepository repository) Initialize a garbage collector.
| |
| anyPackHas | back to summary |
|---|---|
| private boolean anyPackHas(AnyObjectId id) | |
| dayStartInMillis | back to summary |
|---|---|
| private static long dayStartInMillis(long timeInMillis) | |
| estimateGcPackSize | back to summary |
|---|---|
| private long estimateGcPackSize(DfsObjDatabase. | |
| getAllRefs | back to summary |
|---|---|
| private Collection | |
| getCoalesceGarbageLimit | back to summary |
|---|---|
| public long getCoalesceGarbageLimit() Get coalesce garbage limit
| |
| getGarbageTtlMillis | back to summary |
|---|---|
| public long getGarbageTtlMillis() Get time to live for garbage packs.
| |
| getNewPacks | back to summary |
|---|---|
| public List Get new packs created by this compaction.
| |
| getNewPackStatistics | back to summary |
|---|---|
| public List Get statistics corresponding to the The elements can be null if the stat is not available for the pack file.
| |
| getPackConfig | back to summary |
|---|---|
| public PackConfig getPackConfig() Get configuration used to generate the new pack file.
| |
| getSourcePacks | back to summary |
|---|---|
| public Set Get all of the source packs that fed into this compaction.
| |
| hasGcReftable | back to summary |
|---|---|
| private boolean hasGcReftable() | |
| isHead | back to summary |
|---|---|
| private static boolean isHead(Ref ref) | |
| isTag | back to summary |
|---|---|
| private static boolean isTag(Ref ref) | |
| newPackWriter | back to summary |
|---|---|
| private PackWriter newPackWriter() | |
| objectsBefore | back to summary |
|---|---|
| private int objectsBefore() | |
| pack | back to summary |
|---|---|
| public boolean pack(ProgressMonitor pm) throws IOException Create a single new pack file containing all of the live objects. This method safely decides which packs can be expired after the new pack is created by validating the references have not been modified in an incompatible way.
| |
| packGarbage | back to summary |
|---|---|
| private void packGarbage(ProgressMonitor pm) throws IOException | |
| packHeads | back to summary |
|---|---|
| private void packHeads(ProgressMonitor pm) throws IOException | |
| packIsCoalesceableGarbage | back to summary |
|---|---|
| private boolean packIsCoalesceableGarbage(DfsPackDescription d, long now) | |
| packIsExpiredGarbage | back to summary |
|---|---|
| private boolean packIsExpiredGarbage(DfsPackDescription d, long now) | |
| packRest | back to summary |
|---|---|
| private void packRest(ProgressMonitor pm) throws IOException | |
| readPacksBefore | back to summary |
|---|---|
| private void readPacksBefore() throws IOException | |
| readReftablesBefore | back to summary |
|---|---|
| private void readReftablesBefore() throws IOException | |
| setCoalesceGarbageLimit | back to summary |
|---|---|
| public DfsGarbageCollector setCoalesceGarbageLimit(long limit) Set the byte size limit for garbage packs to be repacked. Any UNREACHABLE_GARBAGE pack smaller than this limit will be repacked at the end of the run. This allows the garbage collector to coalesce unreachable objects into a single file. If an UNREACHABLE_GARBAGE pack is already larger than this limit it will be left alone by the garbage collector. This avoids unnecessary disk IO reading and copying the objects.
If limit is set to 0 the UNREACHABLE_GARBAGE coalesce is disabled. Keeping unreachable garbage prevents race conditions with repository changes that may suddenly need an object whose only copy was stored in the UNREACHABLE_GARBAGE pack.
| |
| setConvertToReftable | back to summary |
|---|---|
| public DfsGarbageCollector setConvertToReftable(boolean convert) Whether the garbage collector should convert references to reftable.
| |
| setGarbageTtl | back to summary |
|---|---|
| public DfsGarbageCollector setGarbageTtl(long ttl, TimeUnit unit) Set the time to live for garbage objects. Any UNREACHABLE_GARBAGE older than this limit will be pruned at the end of the run. If timeToLiveMillis is set to 0, UNREACHABLE_GARBAGE purging is disabled.
| |
| setIncludeDeletes | back to summary |
|---|---|
| public DfsGarbageCollector setIncludeDeletes(boolean include) Whether the garbage collector will include tombstones for deleted references in the reftable.
| |
| setPackConfig | back to summary |
|---|---|
| public DfsGarbageCollector setPackConfig(PackConfig newConfig) Set the new configuration to use when creating the pack file.
| |
| setRefLogExpire | back to summary |
|---|---|
| public DfsGarbageCollector setRefLogExpire(Instant refLogExpire) Set time limit to the reflog history.
Garbage Collector prunes entries from reflog history older than
| |
| setReftableConfig | back to summary |
|---|---|
| public DfsGarbageCollector setReftableConfig(ReftableConfig cfg) Set configuration to write a reftable.
| |
| setReftableInitialMaxUpdateIndex | back to summary |
|---|---|
| public DfsGarbageCollector setReftableInitialMaxUpdateIndex(long u) Set maxUpdateIndex for the initial reftable created during conversion.
| |
| setReftableInitialMinUpdateIndex | back to summary |
|---|---|
| public DfsGarbageCollector setReftableInitialMinUpdateIndex(long u) Set minUpdateIndex for the initial reftable created during conversion.
| |
| setWriteBloomFilter | back to summary |
|---|---|
| public DfsGarbageCollector setWriteBloomFilter(boolean enable) Toggle bloom filter generation. False by default.
| |
| setWriteCommitGraph | back to summary |
|---|---|
| public DfsGarbageCollector setWriteCommitGraph(boolean enable) Toggle commit graph generation. False by default.
| |
| toPrune | back to summary |
|---|---|
| private Set | |
| writeCommitGraph | back to summary |
|---|---|
| private void writeCommitGraph(DfsPackDescription pack, ProgressMonitor pm) throws IOException | |
| writePack | back to summary |
|---|---|
| private DfsPackDescription writePack(DfsObjDatabase. | |
| writeReftable | back to summary |
|---|---|
| private void writeReftable() throws IOException | |
| writeReftable | back to summary |
|---|---|
| private void writeReftable(DfsPackDescription pack) throws IOException | |
| writeReftable | back to summary |
|---|---|
| private void writeReftable(DfsPackDescription pack, Collection<Ref> refs) throws IOException | |