Class PackDirectory
java.lang.Object
org.eclipse.jgit.internal.storage.file.PackDirectory
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Config
private final File
private static final org.slf4j.Logger
private static final PackDirectory.PackList
private final AtomicReference<PackDirectory.PackList>
-
Constructor Summary
ConstructorsConstructorDescriptionPackDirectory
(Config config, File directory) Initialize a reference to an on-disk 'pack' directory. -
Method Summary
Modifier and TypeMethodDescription(package private) void
close()
(package private) void
create()
private boolean
doLogExponentialBackoff
(int n) (package private) File
Getter for the fielddirectory
.(package private) Pack
getPack
(AnyObjectId objectId) Get thePack
for the specified object if it is stored in this PackDirectory.(package private) Collection<Pack>
getPacks()
(package private) long
getSize
(WindowCursor curs, AnyObjectId id) private void
handlePackError
(IOException e, Pack p) (package private) boolean
has
(AnyObjectId objectId) Does the requested object exist in this PackDirectory?private static int
(package private) void
(package private) ObjectLoader
open
(WindowCursor curs, AnyObjectId objectId) private void
(package private) boolean
resolve
(Set<ObjectId> matches, AbbreviatedObjectId id, int matchLimit) Find objects matching the prefix abbreviation.private PackDirectory.PackList
scanPacks
(PackDirectory.PackList original) private PackDirectory.PackList
(package private) boolean
(package private) void
selectRepresentation
(PackWriter packer, ObjectToPack otp, WindowCursor curs) toString()
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
NO_PACKS
-
config
-
directory
-
packList
-
-
Constructor Details
-
PackDirectory
Initialize a reference to an on-disk 'pack' directory.- Parameters:
config
- configuration this directory consults for write settings.directory
- the location of thepack
directory.
-
-
Method Details
-
getDirectory
File getDirectory()Getter for the fielddirectory
.- Returns:
- the location of the
pack
directory.
-
create
- Throws:
IOException
-
close
void close() -
getPacks
Collection<Pack> getPacks() -
toString
-
has
Does the requested object exist in this PackDirectory?- Parameters:
objectId
- identity of the object to test for existence of.- Returns:
true
if the specified object is stored in this PackDirectory.
-
getPack
Get thePack
for the specified object if it is stored in this PackDirectory.- Parameters:
objectId
- identity of the object to find the Pack for.- Returns:
Pack
which contains the specified object ornull
if it is not stored in this PackDirectory.
-
resolve
Find objects matching the prefix abbreviation.- Parameters:
matches
- set to add any located ObjectIds to. This is an output parameter.id
- prefix to search for.matchLimit
- maximum number of results to return. At most this many ObjectIds should be added to matches before returning.- Returns:
true
if the matches were exhausted before reachingmaxLimit
.
-
open
-
getSize
-
selectRepresentation
-
handlePackError
-
doLogExponentialBackoff
private boolean doLogExponentialBackoff(int n) - Parameters:
n
- count of consecutive failures- Returns:
-
searchPacksAgain
-
insert
-
remove
-
indexOf
-
scanPacks
-
scanPacksImpl
-
reuseMap
-
getPackFilesByExtById
-