|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jgit.storage.pack.PackConfig
public class PackConfig
Configuration used by a PackWriter
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 | |
---|---|
static int |
DEFAULT_BIG_FILE_THRESHOLD
Default big file threshold: 52428800 |
static boolean |
DEFAULT_DELTA_BASE_AS_OFFSET
Default value of delta base as offset option: false |
static int |
DEFAULT_DELTA_CACHE_LIMIT
Default delta cache limit: 100 |
static long |
DEFAULT_DELTA_CACHE_SIZE
Default delta cache size: 52428800L |
static boolean |
DEFAULT_DELTA_COMPRESS
Default value of delta compress option: true |
static int |
DEFAULT_DELTA_SEARCH_WINDOW_SIZE
Default window size during packing: 10 |
static int |
DEFAULT_INDEX_VERSION
Default index version: 2 |
static int |
DEFAULT_MAX_DELTA_DEPTH
Default value of maximum delta chain depth: 50 |
static boolean |
DEFAULT_REUSE_DELTAS
Default value of deltas reuse option: true |
static boolean |
DEFAULT_REUSE_OBJECTS
Default value of objects reuse option: true |
Constructor Summary | |
---|---|
PackConfig()
Create a default configuration. |
|
PackConfig(Config cfg)
Create a configuration honoring settings in a Config . |
|
PackConfig(PackConfig cfg)
Copy an existing configuration to a new instance. |
|
PackConfig(Repository db)
Create a configuration honoring the repository's settings. |
Method Summary | |
---|---|
void |
fromConfig(Config rc)
Update properties by setting fields from the configuration. |
int |
getBigFileThreshold()
Get the maximum file size that will be delta compressed. |
int |
getCompressionLevel()
Get the compression level applied to objects in the pack. |
int |
getDeltaCacheLimit()
Maximum size in bytes of a delta to cache. |
long |
getDeltaCacheSize()
Get the size of the in-memory delta cache. |
long |
getDeltaSearchMemoryLimit()
Get maximum number of bytes to put into the delta search window. |
int |
getDeltaSearchWindowSize()
Get the number of objects to try when looking for a delta base. |
Executor |
getExecutor()
|
int |
getIndexVersion()
Get the pack index file format version this instance creates. |
int |
getMaxDeltaDepth()
Get maximum depth of delta chain set up for the writer. |
int |
getThreads()
Get the number of threads used during delta compression. |
boolean |
isDeltaBaseAsOffset()
True if writer can use offsets to point to a delta base. |
boolean |
isDeltaCompress()
Check whether the writer will create new deltas on the fly. |
boolean |
isReuseDeltas()
Check whether to reuse deltas existing in repository. |
boolean |
isReuseObjects()
Checks whether to reuse existing objects representation in repository. |
void |
setBigFileThreshold(int bigFileThreshold)
Set the maximum file size that should be considered for deltas. |
void |
setCompressionLevel(int level)
Set the compression level applied to objects in the pack. |
void |
setDeltaBaseAsOffset(boolean deltaBaseAsOffset)
Set writer delta base format. |
void |
setDeltaCacheLimit(int size)
Set the maximum size of a delta that should be cached. |
void |
setDeltaCacheSize(long size)
Set the maximum number of bytes of delta data to cache. |
void |
setDeltaCompress(boolean deltaCompress)
Set whether or not the writer will create new deltas on the fly. |
void |
setDeltaSearchMemoryLimit(long memoryLimit)
Set the maximum number of bytes to put into the delta search window. |
void |
setDeltaSearchWindowSize(int objectCount)
Set the number of objects considered when searching for a delta base. |
void |
setExecutor(Executor executor)
Set the executor to use when using threads. |
void |
setIndexVersion(int version)
Set the pack index file format version this instance will create. |
void |
setMaxDeltaDepth(int maxDeltaDepth)
Set up maximum depth of delta chain for the writer. |
void |
setReuseDeltas(boolean reuseDeltas)
Set reuse deltas configuration option for the writer. |
void |
setReuseObjects(boolean reuseObjects)
Set reuse objects configuration option for the writer. |
void |
setThreads(int threads)
Set the number of threads to use for delta compression. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean DEFAULT_REUSE_DELTAS
setReuseDeltas(boolean)
,
Constant Field Valuespublic static final boolean DEFAULT_REUSE_OBJECTS
setReuseObjects(boolean)
,
Constant Field Valuespublic static final boolean DEFAULT_DELTA_COMPRESS
setDeltaCompress(boolean)
,
Constant Field Valuespublic static final boolean DEFAULT_DELTA_BASE_AS_OFFSET
setDeltaBaseAsOffset(boolean)
,
Constant Field Valuespublic static final int DEFAULT_MAX_DELTA_DEPTH
setMaxDeltaDepth(int)
,
Constant Field Valuespublic static final int DEFAULT_DELTA_SEARCH_WINDOW_SIZE
setDeltaSearchWindowSize(int)
,
Constant Field Valuespublic static final int DEFAULT_BIG_FILE_THRESHOLD
setBigFileThreshold(int)
,
Constant Field Valuespublic static final long DEFAULT_DELTA_CACHE_SIZE
setDeltaCacheSize(long)
,
Constant Field Valuespublic static final int DEFAULT_DELTA_CACHE_LIMIT
setDeltaCacheLimit(int)
,
Constant Field Valuespublic static final int DEFAULT_INDEX_VERSION
setIndexVersion(int)
,
Constant Field ValuesConstructor Detail |
---|
public PackConfig()
public PackConfig(Repository db)
db
- the repository to read settings from. The repository is not
retained by the new configuration, instead its settings are
copied during the constructor.public PackConfig(Config cfg)
Config
.
cfg
- the source to read settings from. The source is not retained
by the new configuration, instead its settings are copied
during the constructor.public PackConfig(PackConfig cfg)
cfg
- the source configuration to copy from.Method Detail |
---|
public boolean isReuseDeltas()
public void setReuseDeltas(boolean reuseDeltas)
reuseDeltas
- boolean indicating whether or not try to reuse deltas.public boolean isReuseObjects()
public void setReuseObjects(boolean reuseObjects)
reuseObjects
- boolean indicating whether or not writer should reuse existing
objects representation.public boolean isDeltaBaseAsOffset()
public void setDeltaBaseAsOffset(boolean deltaBaseAsOffset)
deltaBaseAsOffset
- boolean indicating whether delta base can be stored as an
offset.public boolean isDeltaCompress()
isReuseDeltas()
is false, or no suitable delta is
available for reuse.public void setDeltaCompress(boolean deltaCompress)
deltaCompress
- 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.public int getMaxDeltaDepth()
public void setMaxDeltaDepth(int maxDeltaDepth)
maxDeltaDepth
- maximum delta chain depth.public int getDeltaSearchWindowSize()
public void setDeltaSearchWindowSize(int objectCount)
objectCount
- number of objects to search at once. Must be at least 2.public long getDeltaSearchMemoryLimit()
getDeltaSearchWindowSize()
objects.
This limit is per thread, if 4 threads are used the actual memory limit
will be 4 times this value.
public void setDeltaSearchMemoryLimit(long memoryLimit)
getDeltaSearchWindowSize()
the
window size is temporarily lowered.
memoryLimit
- Maximum number of bytes to load at once, 0 for unlimited.public long getDeltaCacheSize()
public void setDeltaCacheSize(long size)
size
- 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.public int getDeltaCacheLimit()
public void setDeltaCacheLimit(int size)
getDeltaCacheSize()
maximum limit. This speeds up writing
by allowing these cached deltas to be output as-is.
Default setting: 100
size
- maximum size (in bytes) of a delta to be cached.public int getBigFileThreshold()
public void setBigFileThreshold(int bigFileThreshold)
bigFileThreshold
- the limit, in bytes.public int getCompressionLevel()
Deflater
.public void setCompressionLevel(int level)
level
- compression level, must be a valid level recognized by the
Deflater
class.public int getThreads()
public void setThreads(int threads)
setExecutor(Executor)
.
If not set a temporary pool will be created by the writer, and torn down
automatically when compression is over.
Default setting: 0 (auto-detect processors)
threads
- number of threads to use. If <= 0 the number of available
processors for this JVM is used.public Executor getExecutor()
public void setExecutor(Executor executor)
setThreads(int)
to enable threaded
delta search.
executor
- executor to use for threads. Set to null to create a temporary
executor just for the writer.public int getIndexVersion()
PackIndexWriter
public void setIndexVersion(int version)
version
- the version to write. The special version 0 designates the
oldest (most compatible) format available for the objects.PackIndexWriter
public void fromConfig(Config rc)
rc
- configuration to read properties from.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |