Class PackDirectory
java.lang.Object
org.eclipse.jgit.internal.storage.file.PackDirectory
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Configprivate final Fileprivate static final org.slf4j.Loggerprivate static final PackDirectory.PackListprivate 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) voidclose()(package private) voidcreate()private booleandoLogExponentialBackoff(int n) (package private) FileGetter for the fielddirectory.(package private) PackgetPack(AnyObjectId objectId) Get thePackfor the specified object if it is stored in this PackDirectory.(package private) Collection<Pack>getPacks()(package private) longgetSize(WindowCursor curs, AnyObjectId id) private voidhandlePackError(IOException e, Pack p) (package private) booleanhas(AnyObjectId objectId) Does the requested object exist in this PackDirectory?private static int(package private) void(package private) ObjectLoaderopen(WindowCursor curs, AnyObjectId objectId) private void(package private) booleanresolve(Set<ObjectId> matches, AbbreviatedObjectId id, int matchLimit) Find objects matching the prefix abbreviation.private PackDirectory.PackListscanPacks(PackDirectory.PackList original) private PackDirectory.PackList(package private) boolean(package private) voidselectRepresentation(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 thepackdirectory.
-
-
Method Details
-
getDirectory
File getDirectory()Getter for the fielddirectory.- Returns:
- the location of the
packdirectory.
-
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:
trueif the specified object is stored in this PackDirectory.
-
getPack
Get thePackfor the specified object if it is stored in this PackDirectory.- Parameters:
objectId- identity of the object to find the Pack for.- Returns:
Packwhich contains the specified object ornullif 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:
trueif 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
-