Top Description Fields Constructors Methods
org.eclipse.jgit.storage.pack

public Class PackConfig

extends Object
Class Inheritance
Static Imports
org.eclipse.jgit.lib.ConfigConstants.CONFIG_CORE_SECTION, .ConfigConstants.CONFIG_KEY_BIGFILE_THRESHOLD, .ConfigConstants.CONFIG_KEY_BITMAP_CONTIGUOUS_COMMIT_COUNT, .ConfigConstants.CONFIG_KEY_BITMAP_DISTANT_COMMIT_SPAN, .ConfigConstants.CONFIG_KEY_BITMAP_EXCESSIVE_BRANCH_COUNT, .ConfigConstants.CONFIG_KEY_BITMAP_EXCESSIVE_BRANCH_TIP_COUNT, .ConfigConstants.CONFIG_KEY_BITMAP_EXCLUDED_REFS_PREFIXES, .ConfigConstants.CONFIG_KEY_BITMAP_INACTIVE_BRANCH_AGE_INDAYS, .ConfigConstants.CONFIG_KEY_BITMAP_RECENT_COMMIT_COUNT, .ConfigConstants.CONFIG_KEY_BUILD_BITMAPS, .ConfigConstants.CONFIG_KEY_COMPRESSION, .ConfigConstants.CONFIG_KEY_CUT_DELTACHAINS, .ConfigConstants.CONFIG_KEY_DELTA_CACHE_LIMIT, .ConfigConstants.CONFIG_KEY_DELTA_CACHE_SIZE, .ConfigConstants.CONFIG_KEY_DELTA_COMPRESSION, .ConfigConstants.CONFIG_KEY_DEPTH, .ConfigConstants.CONFIG_KEY_INDEXVERSION, .ConfigConstants.CONFIG_KEY_MIN_BYTES_OBJ_SIZE_INDEX, .ConfigConstants.CONFIG_KEY_MIN_SIZE_PREVENT_RACYPACK, .ConfigConstants.CONFIG_KEY_PACK_KEPT_OBJECTS, .ConfigConstants.CONFIG_KEY_PRESERVE_OLD_PACKS, .ConfigConstants.CONFIG_KEY_PRUNE_PRESERVED, .ConfigConstants.CONFIG_KEY_REUSE_DELTAS, .ConfigConstants.CONFIG_KEY_REUSE_OBJECTS, .ConfigConstants.CONFIG_KEY_SEARCH_FOR_REUSE_TIMEOUT, .ConfigConstants.CONFIG_KEY_SINGLE_PACK, .ConfigConstants.CONFIG_KEY_THREADS, .ConfigConstants.CONFIG_KEY_WAIT_PREVENT_RACYPACK, .ConfigConstants.CONFIG_KEY_WINDOW, .ConfigConstants.CONFIG_KEY_WINDOW_MEMORY, .ConfigConstants.CONFIG_KEY_WRITE_REVERSE_INDEX, .ConfigConstants.CONFIG_PACK_SECTION, .ConfigConstants.CONFIG_REPACK_SECTION

Configuration used by a pack writer when constructing the stream. A configuration may be modified once created, but should not be modified while it is being used by a PackWriter. If a configuration is not modified it is safe to share the same configuration instance between multiple concurrent threads executing different PackWriters.

Field Summary

Modifier and TypeField and Description
private int
private int
private int
private int
private int
private String[]
private int
private int
private int
private boolean
private int
private boolean
public static final int
DEFAULT_BIG_FILE_THRESHOLD

Default big file threshold:

public static final int
DEFAULT_BITMAP_CONTIGUOUS_COMMIT_COUNT

Default count of most recent commits to select for bitmaps.

public static final int
DEFAULT_BITMAP_DISTANT_COMMIT_SPAN

Default spacing between commits in distant history when selecting commits for bitmaps.

public static final int
DEFAULT_BITMAP_EXCESSIVE_BRANCH_COUNT

Default count of branches required to activate inactive branch commit selection.

public static final int
DEFAULT_BITMAP_EXCESSIVE_BRANCH_TIP_COUNT

Default maxium count of branches to create tip bitmaps for.

public static final String[]
DEFAULT_BITMAP_EXCLUDED_REFS_PREFIXES

Default refs prefixes excluded from the calculation of pack bitmaps.

public static final int
DEFAULT_BITMAP_INACTIVE_BRANCH_AGE_IN_DAYS

Default age at which a branch is considered inactive.

public static final int
DEFAULT_BITMAP_RECENT_COMMIT_COUNT

Count at which the span between selected commits changes from "bitmapRecentCommitSpan" to "bitmapDistantCommitSpan".

public static final int
DEFAULT_BITMAP_RECENT_COMMIT_SPAN

Default spacing between commits in recent history when selecting commits for bitmaps.

public static final boolean
DEFAULT_BUILD_BITMAPS

Default value of the build bitmaps option:

public static final boolean
DEFAULT_DELTA_BASE_AS_OFFSET

Default value of delta base as offset option:

public static final int
DEFAULT_DELTA_CACHE_LIMIT

Default delta cache limit:

public static final long
DEFAULT_DELTA_CACHE_SIZE

Default delta cache size:

public static final boolean
DEFAULT_DELTA_COMPRESS

Default value of delta compress option:

public static final int
DEFAULT_DELTA_SEARCH_WINDOW_SIZE

Default window size during packing:

public static final int
DEFAULT_INDEX_VERSION

Default index version:

public static final int
DEFAULT_MAX_DELTA_DEPTH

Default value of maximum delta chain depth:

public static final int
DEFAULT_MIN_BYTES_FOR_OBJ_SIZE_INDEX

Default minimum size for an object to be included in the size index:

public static final long
DEFAULT_MINSIZE_PREVENT_RACY_PACK

Default if we wait before opening a newly written pack to prevent its lastModified timestamp could be racy

public static final boolean
DEFAULT_PACK_KEPT_OBJECTS

Default value for including objects in packs locked by .keep file when repacking:

public static final boolean
DEFAULT_PRESERVE_OLD_PACKS

Default value of keep old packs option:

public static final boolean
DEFAULT_PRUNE_PRESERVED

Default value of prune old packs option:

public static final boolean
DEFAULT_REUSE_DELTAS

Default value of deltas reuse option:

public static final boolean
DEFAULT_REUSE_OBJECTS

Default value of objects reuse option:

public static final Duration
DEFAULT_SEARCH_FOR_REUSE_TIMEOUT

Default max time to spend during the search for reuse phase.

public static final boolean
DEFAULT_WAIT_PREVENT_RACY_PACK

Default if we wait before opening a newly written pack to prevent its lastModified timestamp could be racy

public static final boolean
DEFAULT_WRITE_REVERSE_INDEX

Default value of the write reverse index option:

private boolean
private int
private long
private boolean
private long
private int
private Executor
private int
private int
private static final int
private int
private long
private boolean
private boolean
private boolean
private boolean
private boolean
private Duration
private boolean
private int
private boolean
private boolean

Constructor Summary

AccessConstructor and Description
public
PackConfig()

Create a default configuration.

public
PackConfig(Repository
the repository to read settings from. The repository is not retained by the new configuration, instead its settings are copied during the constructor.
db
)

Create a configuration honoring the repository's settings.

public
PackConfig(Config
the source to read settings from. The source is not retained by the new configuration, instead its settings are copied during the constructor.
cfg
)

Create a configuration honoring settings in a org.eclipse.jgit.lib.Config.

public
PackConfig(PackConfig
the source configuration to copy from.
cfg
)

Copy an existing configuration to a new instance.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

whether we wait before opening a newly written pack to prevent its lastModified timestamp could be racy
doWaitPreventRacyPack
(long
size of the pack file
packSize
)

Get whether we wait before opening a newly written pack to prevent its lastModified timestamp could be racy.

public void
fromConfig(Config
configuration to read properties from.
rc
)

Update properties by setting fields from the configuration.

public int

Returns:

the configured big file threshold.
getBigFileThreshold
()

Get the maximum file size that will be delta compressed.

public int

Returns:

the count of most recent commits for which to build bitmaps
getBitmapContiguousCommitCount
()

Get the count of most recent commits for which to build bitmaps.

public int

Returns:

the span of commits when building bitmaps for distant history
getBitmapDistantCommitSpan
()

Get the span of commits when building bitmaps for distant history.

public int

Returns:

the count of branches deemed "excessive"
getBitmapExcessiveBranchCount
()

Get the count of branches deemed "excessive".

public int

Returns:

the count of branch tips deemed "excessive"
getBitmapExcessiveBranchTipCount
()

Get the count of branches deemed "excessive".

public String[]

Returns:

the refs prefixes excluded from the Bitmap.
getBitmapExcludedRefsPrefixes
()

Get the refs prefixes excluded from the Bitmap.

public int

Returns:

the age in days that marks a branch as "inactive"
getBitmapInactiveBranchAgeInDays
()

Get the age in days that marks a branch as "inactive".

public int

Returns:

the count for switching between recent and distant spans
getBitmapRecentCommitCount
()

Get the count at which to switch from "bitmapRecentCommitSpan" to "bitmapDistantCommitSpan".

public int

Returns:

the span of commits when building bitmaps for recent history
getBitmapRecentCommitSpan
()

Get the span of commits when building bitmaps for recent history.

public int

Returns:

current compression level, see java.util.zip.Deflater.
getCompressionLevel
()

Get the compression level applied to objects in the pack.

public boolean

Returns:

true if existing delta chains should be cut at getMaxDeltaDepth(). Default is false, allowing existing chains to be of any length.
getCutDeltaChains
()

Whether existing delta chains should be cut at getMaxDeltaDepth().

public int

Returns:

maximum size (in bytes) of a delta that should be cached.
getDeltaCacheLimit
()

Maximum size in bytes of a delta to cache.

public long

Returns:

maximum number of bytes worth of delta data to cache in memory. If 0 the cache is infinite in size (up to the JVM heap limit anyway). A very tiny size such as 1 indicates the cache is effectively disabled.
getDeltaCacheSize
()

Get the size of the in-memory delta cache.

public long

Returns:

the memory limit.
getDeltaSearchMemoryLimit
()

Get maximum number of bytes to put into the delta search window.

public int

Returns:

the object count to be searched.
getDeltaSearchWindowSize
()

Get the number of objects to try when looking for a delta base.

public Executor

Returns:

the preferred thread pool to execute delta search on.
getExecutor
()

Get the preferred thread pool to execute delta search on.

public int

Returns:

the index version, the special version 0 designates the oldest (most compatible) format available for the objects.
getIndexVersion
()

Get the pack index file format version this instance creates.

public int

Returns:

maximum delta chain depth.
getMaxDeltaDepth
()

Get maximum depth of delta chain set up for the writer.

public int

Returns:

minimum size an object must have to be included in the object index.
getMinBytesForObjSizeIndex
()

Minimum size of an object (inclusive) to be added in the object size index.

public long

Returns:

minimum packfile size, default is 100 MiB
getMinSizePreventRacyPack
()

Get minimum packfile size for which we wait before opening a newly written pack to prevent its lastModified timestamp could be racy if isWaitToPreventRacyPack is true.

public Duration

Returns:

the maximum time to spend during the search for reuse phase.
getSearchForReuseTimeout
()

Get the max time to spend during the search for reuse phase.

public boolean

Returns:

true if all of refs/* should be packed in a single pack. Default is false, packing a separate GC_REST pack for references outside of refs/heads/* and refs/tags/*.
getSinglePack
()

Whether all of refs/* should be packed in a single pack.

public int

Returns:

number of threads used for delta compression. 0 will auto-detect the threads to the number of available processors.
getThreads
()

Get the number of threads used during delta compression.

public boolean

Returns:

true if delta base is the writer can choose to output an index with bitmaps.
isBuildBitmaps
()

True if writer is allowed to build bitmaps for indexes.

public boolean

Returns:

true if delta base is stored as an offset; false if it is stored as an ObjectId.
isDeltaBaseAsOffset
()

True if writer can use offsets to point to a delta base.

public boolean

Returns:

true if the writer will create a new delta when either isReuseDeltas() is false, or no suitable delta is available for reuse.
isDeltaCompress
()

Check whether the writer will create new deltas on the fly.

public boolean

Returns:

True if objects in `.keep` files should be included when repacking.
isPackKeptObjects
()

True if objects in `.keep` files should be included when repacking.

public boolean

Returns:

true if repacking will preserve old pack files.
isPreserveOldPacks
()

Checks whether to preserve old packs in a preserved directory Default setting: false

public boolean

Returns:

true if repacking will remove preserved pack files.
isPrunePreserved
()

Checks whether to remove preserved pack files in a preserved directory Default setting: false

public boolean

Returns:

true if object is configured to reuse deltas; false otherwise.
isReuseDeltas
()

Check whether to reuse deltas existing in repository.

public boolean

Returns:

true if writer is configured to reuse objects representation from pack; false otherwise.
isReuseObjects
()

Checks whether to reuse existing objects representation in repository.

public boolean

Returns:

whether we wait before opening a newly written pack to prevent its lastModified timestamp could be racy
isWaitPreventRacyPack
()

Get whether we wait before opening a newly written pack to prevent its lastModified timestamp could be racy

public boolean

Returns:

true to write an object-size index with the pack
isWriteObjSizeIndex
()

Should writers add an object size index when writing a pack.

public boolean

Returns:

whether the writer should write reverse index files
isWriteReverseIndex
()

True if the writer should write reverse index files.

public void
setBigFileThreshold(int
the limit, in bytes.
bigFileThreshold
)

Set the maximum file size that should be considered for deltas.

public void
setBitmapContiguousCommitCount(int
the count of most recent commits for which to build bitmaps
count
)

Set the count of most recent commits for which to build bitmaps.

public void
setBitmapDistantCommitSpan(int
the span of commits when building bitmaps for distant history
span
)

Set the span of commits when building bitmaps for distant history.

public void
setBitmapExcessiveBranchCount(int
the count of branches deemed "excessive"
count
)

Set the count of branches deemed "excessive".

public void
setBitmapExcessiveBranchTipCount(int
the count of branch tips deemed "excessive"
count
)

Get the count of branches deemed "excessive".

public void
setBitmapExcludedRefsPrefixes(String[]
the refs prefixes excluded from the Bitmap.
excludedRefsPrefixes
)

Set the refs prefixes excluded from the Bitmap.

public void
setBitmapInactiveBranchAgeInDays(int
the age in days that marks a branch as "inactive"
ageInDays
)

Set the age in days that marks a branch as "inactive".

public void
setBitmapRecentCommitCount(int
the count for switching between recent and distant spans
count
)

Set the count at which to switch from "bitmapRecentCommitSpan" to "bitmapDistantCommitSpan".

public void
setBitmapRecentCommitSpan(int
the span of commits when building bitmaps for recent history
span
)

Set the span of commits when building bitmaps for recent history.

public void
setBuildBitmaps(boolean
boolean indicating whether bitmaps may be included in the index.
buildBitmaps
)

Set writer to allow building bitmaps for supported pack files.

public void
setCompressionLevel(int
compression level, must be a valid level recognized by the java.util.zip.Deflater class.
level
)

Set the compression level applied to objects in the pack.

public void
setCutDeltaChains(boolean
true to cut existing chains.
cut
)

Enable cutting existing delta chains at getMaxDeltaDepth().

public void
setDeltaBaseAsOffset(boolean
boolean indicating whether delta base can be stored as an offset.
deltaBaseAsOffset
)

Set writer delta base format.

public void
setDeltaCacheLimit(int
maximum size (in bytes) of a delta to be cached.
size
)

Set the maximum size of a delta that should be cached.

public void
setDeltaCacheSize(long
number of bytes to cache. Set to 0 to enable an infinite cache, set to 1 (an impossible size for any delta) to disable the cache.
size
)

Set the maximum number of bytes of delta data to cache.

public void
setDeltaCompress(boolean
true to create deltas when isReuseDeltas() is false, or when a suitable delta isn't available for reuse. Set to false to write whole objects instead.
deltaCompress
)

Set whether or not the writer will create new deltas on the fly.

public void
setDeltaSearchMemoryLimit(long
Maximum number of bytes to load at once, 0 for unlimited.
memoryLimit
)

Set the maximum number of bytes to put into the delta search window.

public void
setDeltaSearchWindowSize(int
number of objects to search at once. Must be at least 2.
objectCount
)

Set the number of objects considered when searching for a delta base.

public void
setExecutor(Executor
executor to use for threads. Set to null to create a temporary executor just for the writer.
executor
)

Set the executor to use when using threads.

public void
setIndexVersion(int
the version to write. The special version 0 designates the oldest (most compatible) format available for the objects.
version
)

Set the pack index file format version this instance will create.

public void
setMaxDeltaDepth(int
maximum delta chain depth.
maxDeltaDepth
)

Set up maximum depth of delta chain for the writer.

public void
setMinBytesForObjSizeIndex(int
minimum size (inclusive) of an object to be included in the object size index. -1 disables the index.
minBytesForObjSizeIndex
)

Set minimum size an object must have to be included in the object size index.

public void
setMinSizePreventRacyPack(long
minimum packfile size, default is 100 MiB
minSizePreventRacyPack
)

Set minimum packfile size for which we wait before opening a newly written pack to prevent its lastModified timestamp could be racy if isWaitToPreventRacyPack is true.

public void
setPackKeptObjects(boolean
boolean indicating whether to include objects in `.keep` files when repacking.
packKeptObjects
)

Set whether to include objects in `.keep` files when repacking.

public void
setPreserveOldPacks(boolean
boolean indicating whether or not preserve old pack files
preserveOldPacks
)

Set preserve old packs configuration option for repacking.

public void
setPrunePreserved(boolean
boolean indicating whether or not preserve old pack files
prunePreserved
)

Set prune preserved configuration option for repacking.

public void
setReuseDeltas(boolean
boolean indicating whether or not try to reuse deltas.
reuseDeltas
)

Set reuse deltas configuration option for the writer.

public void
setReuseObjects(boolean
boolean indicating whether or not writer should reuse existing objects representation.
reuseObjects
)

Set reuse objects configuration option for the writer.

public void
setSearchForReuseTimeout(Duration
max time allowed during the search for reuse phase Default setting: DEFAULT_SEARCH_FOR_REUSE_TIMEOUT
timeout
)

Set the max time to spend during the search for reuse phase.

public void
setSinglePack(boolean
true to pack a single GC pack rather than GC and GC_REST packs
single
)

If true, packs a single GC pack for all objects reachable from refs/*.

public void
setThreads(int
number of threads to use. If <= 0 the number of available processors for this JVM is used.
threads
)

Set the number of threads to use for delta compression.

public void
setWaitPreventRacyPack(boolean
whether we wait before opening a newly written pack to prevent its lastModified timestamp could be racy
waitPreventRacyPack
)

Set whether we wait before opening a newly written pack to prevent its lastModified timestamp could be racy

public void
setWriteReverseIndex(boolean
whether the writer should write reverse index files
writeReverseIndex
)

Set whether the writer will write reverse index files.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait