org.eclipse.jgit.internal.storage.file.FileRepository . Instances of
this class are not thread-safe. Don't use the same instance from multiple
threads.
This class started as a copy of DfsGarbageCollector from Shawn O. Pearce
adapted to FileRepositories.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| public static class | GC.
A class holding statistical data for a FileRepository regarding how many objects are stored as loose or packed objects |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | automatic
Whether gc should do automatic housekeeping |
| private boolean | background
Whether to run gc in a background thread |
| private static final Set | |
| private static final int | |
| private static final int | |
| private static final boolean | |
| private static final boolean | |
| private static volatile ExecutorService | |
| private Instant | |
| private long | |
| private Collection | lastPackedRefs
the refs which existed during the last call to |
| private long | lastRepackTime
Holds the starting time of the last repack() execution. |
| private static final Logger | |
| private Instant | |
| private long | |
| private Boolean | |
| private static final Set | |
| private static final Pattern | |
| private PackConfig | |
| private ProgressMonitor | |
| private static final String | |
| private static final String | |
| private final FileRepository |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private boolean | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | deleteOldPacks(Collection<Pack>
old pack files oldPacks, Collection<Pack> new pack files newPacks)Delete old pack files. |
| private void | deleteOrphans()
Deletes orphans A file is considered an orphan if it is some type of index file, but there is not a corresponding pack or keep file present in the directory. |
| private void | |
| private void | |
| private Collection | |
| private static boolean | |
| private ExecutorService | |
| public CompletableFuture | Returns: the collection oforg.'s which are
newly createdRuns a garbage collector on a
|
| private Collection | Returns: a collection of refs pointing to live objects.Returns a collection of all refs and additional refs. |
| private long | |
| private int | |
| private long | |
| private String | |
| public GC. | Returns: information about objects and pack files for a FileRepositoryReturns information about objects and pack files for a FileRepository. |
| private boolean | |
| private static boolean | |
| private static boolean | |
| private Set | Returns: a set of ObjectIds of changed objects in the indexReturn a list of those objects in the index which differ from whats in HEAD |
| private Set | Returns: theObjectIds contained in the reflogthe ref which log should be inspected ref, long only reflog entries not older then this time are processed minTime)
|
| private void | loosen(ObjectDirectoryInserter
used to insert objects inserter, ObjectReader used to read objects reader, Pack the pack file to loosen objects for pack, HashSet<ObjectId> existing objects existing)Loosen objects in a pack file which are not also in the newly-created pack files. |
| private boolean | |
| public void | |
| private void | |
| public void | prunePacked()
Like "git prune-packed" this method tries to prune all loose objects which can be found in packs. |
| private void | |
| private Set | |
| private void | removeOldPack(PackFile
the packfile to delete packFile, int delete option flags deleteOptions)Deletes old pack file, unless 'preserve-oldpacks' is set, in which case it moves the pack file to the preserved directory |
| private void | removeReferenced(Map<ObjectId, File>
mapping objectIds to files id2File, ObjectWalk used to walk objects w)Remove all entries from a map which key is the id of an object referenced by the given ObjectWalk |
| public Collection | Returns: a collection of the newly created pack filesPacks all objects which reachable from any of the heads into one pack file. |
| public void | |
| pack-priv void | |
| public static void | setExecutor(ExecutorService
the executor to be used for running auto-gc e)Set the executor for running auto-gc in the background. |
| public void | setExpire(Date
instant in time which defines object expiration objects with
modification time before this instant are expired objects with
modification time newer or equal to this instant are not
expired expire)
Deprecated
since 7.2. use
setExpire(Instant) instead
During gc() or prune() each unreferenced, loose object which has been
created or modified after or at |
| public void | setExpire(Instant
instant in time which defines object expiration objects with
modification time before this instant are expired objects with
modification time newer or equal to this instant are not
expired expire)During gc() or prune() each unreferenced, loose object which has been
created or modified after or at |
| public void | setExpireAgeMillis(long
minimal age of objects to be pruned in milliseconds. expireAgeMillis)During gc() or prune() each unreferenced, loose object which has been
created or modified in the last |
| public void | setPackConfig(PackConfig
the pconfig)org. used when
writing packsSet the PackConfig used when (re-)writing packfiles. |
| public void | setPackExpire(Date
instant in time which defines packfile expiration packExpire)
Deprecated
since 7.2. use
setPackExpire(Instant) instead
During gc() or prune() packfiles which are created or modified after or
at |
| public void | setPackExpire(Instant
instant in time which defines packfile expiration packExpire)During gc() or prune() packfiles which are created or modified after or
at |
| public void | setPackExpireAgeMillis(long
minimal age of packfiles to be deleted in milliseconds. packExpireAgeMillis)During gc() or prune() packfiles which are created or modified in the
last |
| public void | setPackKeptObjects(boolean
Whether to include objects in `.keep` files when repacking. packKeptObjects)Define whether to include objects in `.keep` files when repacking. |
| public GC | Returns: thisa pm)org. object.Set the progress monitor used for garbage collection methods. |
| private boolean | |
| pack-priv boolean | Returns: true if bloom filter should be written. Default isfalse.If |
| pack-priv boolean | Returns: true if commit-graph should be written. Default isfalse.If |
| pack-priv boolean | Returns: true if number of loose objects > gc.auto (default
6700)Quickly estimate number of loose objects, SHA1 is distributed evenly so counting objects in one directory (bucket 17) is sufficient |
| pack-priv boolean | Returns: true if number of packs > gc.autopacklimit (default
50)Whether number of packs exceeds gc.autopacklimit |
| private static Optional | |
| private Set | |
| pack-priv void | writeCommitGraph(Set<? extends ObjectId>
the list of wanted objects, writer walks commits starting at
these. Must not be wants)null.Generate a new commit-graph file when 'core.commitGraph' is true. |
| private Pack |