Browse Source

Define constants for pack config option keys

Change-Id: Ifb8227cb62370029d6774f2a22b15d6478c713ca
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.8
Matthias Sohn 5 years ago committed by David Pursehouse
parent
commit
26b23b2713
  1. 120
      org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
  2. 114
      org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackConfig.java

120
org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java

@ -542,4 +542,124 @@ public final class ConfigConstants {
* @since 5.1.13 * @since 5.1.13
*/ */
public static final String CONFIG_JMX_SECTION = "jmx"; public static final String CONFIG_JMX_SECTION = "jmx";
/**
* The "pack.bigfilethreshold" key
* @since 5.8
*/
public static final String CONFIG_KEY_BIGFILE_THRESHOLD = "bigfilethreshold";
/**
* The "pack.bitmapContiguousCommitCount" key
* @since 5.8
*/
public static final String CONFIG_KEY_BITMAP_CONTIGUOUS_COMMIT_COUNT = "bitmapcontiguouscommitcount";
/**
* The "pack.bitmapDistantCommitSpan" key
* @since 5.8
*/
public static final String CONFIG_KEY_BITMAP_DISTANT_COMMIT_SPAN = "bitmapdistantcommitspan";
/**
* The "pack.bitmapExcessiveBranchCount" key
* @since 5.8
*/
public static final String CONFIG_KEY_BITMAP_EXCESSIVE_BRANCH_COUNT = "bitmapexcessivebranchcount";
/**
* The "pack.bitmapInactiveBranchAgeInDays" key
* @since 5.8
*/
public static final String CONFIG_KEY_BITMAP_INACTIVE_BRANCH_AGE_INDAYS = "bitmapinactivebranchageindays";
/**
* The "pack.bitmapRecentCommitSpan" key
* @since 5.8
*/
public static final String CONFIG_KEY_BITMAP_RECENT_COMMIT_COUNT = "bitmaprecentcommitspan";
/**
* The "pack.buildBitmaps" key
* @since 5.8
*/
public static final String CONFIG_KEY_BUILD_BITMAPS = "buildbitmaps";
/**
* The "pack.cutDeltaChains" key
* @since 5.8
*/
public static final String CONFIG_KEY_CUT_DELTACHAINS = "cutdeltachains";
/**
* The "pack.deltaCacheLimit" key
* @since 5.8
*/
public static final String CONFIG_KEY_DELTA_CACHE_LIMIT = "deltacachelimit";
/**
* The "pack.deltaCacheSize" key
* @since 5.8
*/
public static final String CONFIG_KEY_DELTA_CACHE_SIZE = "deltacachesize";
/**
* The "pack.deltaCompression" key
* @since 5.8
*/
public static final String CONFIG_KEY_DELTA_COMPRESSION = "deltacompression";
/**
* The "pack.depth" key
* @since 5.8
*/
public static final String CONFIG_KEY_DEPTH = "depth";
/**
* The "pack.minSizePreventRacyPack" key
* @since 5.8
*/
public static final String CONFIG_KEY_MIN_SIZE_PREVENT_RACYPACK = "minsizepreventracypack";
/**
* The "pack.reuseDeltas" key
* @since 5.8
*/
public static final String CONFIG_KEY_REUSE_DELTAS = "reusedeltas";
/**
* The "pack.reuseObjects" key
* @since 5.8
*/
public static final String CONFIG_KEY_REUSE_OBJECTS = "reuseobjects";
/**
* The "pack.singlePack" key
* @since 5.8
*/
public static final String CONFIG_KEY_SINGLE_PACK = "singlepack";
/**
* The "pack.threads" key
* @since 5.8
*/
public static final String CONFIG_KEY_THREADS = "threads";
/**
* The "pack.waitPreventRacyPack" key
* @since 5.8
*/
public static final String CONFIG_KEY_WAIT_PREVENT_RACYPACK = "waitpreventracypack";
/**
* The "pack.window" key
* @since 5.8
*/
public static final String CONFIG_KEY_WINDOW = "window";
/**
* The "pack.windowMemory" key
* @since 5.8
*/
public static final String CONFIG_KEY_WINDOW_MEMORY = "windowmemory";
} }

114
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackConfig.java

@ -11,6 +11,31 @@
package org.eclipse.jgit.storage.pack; package org.eclipse.jgit.storage.pack;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_CORE_SECTION;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_BIGFILE_THRESHOLD;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_BITMAP_CONTIGUOUS_COMMIT_COUNT;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_BITMAP_DISTANT_COMMIT_SPAN;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_BITMAP_EXCESSIVE_BRANCH_COUNT;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_BITMAP_INACTIVE_BRANCH_AGE_INDAYS;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_BITMAP_RECENT_COMMIT_COUNT;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_BUILD_BITMAPS;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_COMPRESSION;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_CUT_DELTACHAINS;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_DELTA_CACHE_LIMIT;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_DELTA_CACHE_SIZE;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_DELTA_COMPRESSION;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_DEPTH;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_INDEXVERSION;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_MIN_SIZE_PREVENT_RACYPACK;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_REUSE_DELTAS;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_REUSE_OBJECTS;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_SINGLE_PACK;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_THREADS;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_WAIT_PREVENT_RACYPACK;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_WINDOW;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_WINDOW_MEMORY;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_PACK_SECTION;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import java.util.zip.Deflater; import java.util.zip.Deflater;
@ -1101,52 +1126,63 @@ public class PackConfig {
* configuration to read properties from. * configuration to read properties from.
*/ */
public void fromConfig(Config rc) { public void fromConfig(Config rc) {
setMaxDeltaDepth(rc.getInt("pack", "depth", getMaxDeltaDepth())); //$NON-NLS-1$ //$NON-NLS-2$ setMaxDeltaDepth(rc.getInt(CONFIG_PACK_SECTION, CONFIG_KEY_DEPTH,
setDeltaSearchWindowSize(rc.getInt( getMaxDeltaDepth()));
"pack", "window", getDeltaSearchWindowSize())); //$NON-NLS-1$ //$NON-NLS-2$ setDeltaSearchWindowSize(rc.getInt(CONFIG_PACK_SECTION,
setDeltaSearchMemoryLimit(rc.getLong( CONFIG_KEY_WINDOW, getDeltaSearchWindowSize()));
"pack", "windowmemory", getDeltaSearchMemoryLimit())); //$NON-NLS-1$ //$NON-NLS-2$ setDeltaSearchMemoryLimit(rc.getLong(CONFIG_PACK_SECTION,
setDeltaCacheSize(rc.getLong( CONFIG_KEY_WINDOW_MEMORY, getDeltaSearchMemoryLimit()));
"pack", "deltacachesize", getDeltaCacheSize())); //$NON-NLS-1$ //$NON-NLS-2$ setDeltaCacheSize(rc.getLong(CONFIG_PACK_SECTION,
setDeltaCacheLimit(rc.getInt( CONFIG_KEY_DELTA_CACHE_SIZE, getDeltaCacheSize()));
"pack", "deltacachelimit", getDeltaCacheLimit())); //$NON-NLS-1$ //$NON-NLS-2$ setDeltaCacheLimit(rc.getInt(CONFIG_PACK_SECTION,
setCompressionLevel(rc.getInt("pack", "compression", //$NON-NLS-1$ //$NON-NLS-2$ CONFIG_KEY_DELTA_CACHE_LIMIT, getDeltaCacheLimit()));
rc.getInt("core", "compression", getCompressionLevel()))); //$NON-NLS-1$ //$NON-NLS-2$ setCompressionLevel(rc.getInt(CONFIG_PACK_SECTION,
setIndexVersion(rc.getInt("pack", "indexversion", getIndexVersion())); //$NON-NLS-1$ //$NON-NLS-2$ CONFIG_KEY_COMPRESSION, rc.getInt(CONFIG_CORE_SECTION,
setBigFileThreshold(rc.getInt( CONFIG_KEY_COMPRESSION, getCompressionLevel())));
"core", "bigfilethreshold", getBigFileThreshold())); //$NON-NLS-1$ //$NON-NLS-2$ setIndexVersion(rc.getInt(CONFIG_PACK_SECTION,
setThreads(rc.getInt("pack", "threads", getThreads())); //$NON-NLS-1$ //$NON-NLS-2$ CONFIG_KEY_INDEXVERSION,
getIndexVersion()));
setBigFileThreshold(rc.getInt(CONFIG_CORE_SECTION,
CONFIG_KEY_BIGFILE_THRESHOLD, getBigFileThreshold()));
setThreads(rc.getInt(CONFIG_PACK_SECTION, CONFIG_KEY_THREADS,
getThreads()));
// These variables aren't standardized // These variables aren't standardized
// setReuseDeltas(rc.getBoolean(CONFIG_PACK_SECTION,
setReuseDeltas(rc.getBoolean("pack", "reusedeltas", isReuseDeltas())); //$NON-NLS-1$ //$NON-NLS-2$ CONFIG_KEY_REUSE_DELTAS, isReuseDeltas()));
setReuseObjects( setReuseObjects(rc.getBoolean(CONFIG_PACK_SECTION,
rc.getBoolean("pack", "reuseobjects", isReuseObjects())); //$NON-NLS-1$ //$NON-NLS-2$ CONFIG_KEY_REUSE_OBJECTS, isReuseObjects()));
setDeltaCompress( setDeltaCompress(rc.getBoolean(CONFIG_PACK_SECTION,
rc.getBoolean("pack", "deltacompression", isDeltaCompress())); //$NON-NLS-1$ //$NON-NLS-2$ CONFIG_KEY_DELTA_COMPRESSION, isDeltaCompress()));
setCutDeltaChains( setCutDeltaChains(rc.getBoolean(CONFIG_PACK_SECTION,
rc.getBoolean("pack", "cutdeltachains", getCutDeltaChains())); //$NON-NLS-1$ //$NON-NLS-2$ CONFIG_KEY_CUT_DELTACHAINS, getCutDeltaChains()));
setSinglePack( setSinglePack(rc.getBoolean(CONFIG_PACK_SECTION,
rc.getBoolean("pack", "singlepack", getSinglePack())); //$NON-NLS-1$ //$NON-NLS-2$ CONFIG_KEY_SINGLE_PACK,
setBuildBitmaps( getSinglePack()));
rc.getBoolean("pack", "buildbitmaps", isBuildBitmaps())); //$NON-NLS-1$ //$NON-NLS-2$ setBuildBitmaps(rc.getBoolean(CONFIG_PACK_SECTION,
setBitmapContiguousCommitCount( CONFIG_KEY_BUILD_BITMAPS, isBuildBitmaps()));
rc.getInt("pack", "bitmapcontiguouscommitcount", //$NON-NLS-1$ //$NON-NLS-2$ setBitmapContiguousCommitCount(rc.getInt(CONFIG_PACK_SECTION,
CONFIG_KEY_BITMAP_CONTIGUOUS_COMMIT_COUNT,
getBitmapContiguousCommitCount())); getBitmapContiguousCommitCount()));
setBitmapRecentCommitCount(rc.getInt("pack", "bitmaprecentcommitcount", //$NON-NLS-1$ //$NON-NLS-2$ setBitmapRecentCommitCount(rc.getInt(CONFIG_PACK_SECTION,
CONFIG_KEY_BITMAP_RECENT_COMMIT_COUNT,
getBitmapRecentCommitCount())); getBitmapRecentCommitCount()));
setBitmapRecentCommitSpan(rc.getInt("pack", "bitmaprecentcommitspan", //$NON-NLS-1$ //$NON-NLS-2$ setBitmapRecentCommitSpan(rc.getInt(CONFIG_PACK_SECTION,
CONFIG_KEY_BITMAP_RECENT_COMMIT_COUNT,
getBitmapRecentCommitSpan())); getBitmapRecentCommitSpan()));
setBitmapDistantCommitSpan(rc.getInt("pack", "bitmapdistantcommitspan", //$NON-NLS-1$ //$NON-NLS-2$ setBitmapDistantCommitSpan(rc.getInt(CONFIG_PACK_SECTION,
CONFIG_KEY_BITMAP_DISTANT_COMMIT_SPAN,
getBitmapDistantCommitSpan())); getBitmapDistantCommitSpan()));
setBitmapExcessiveBranchCount(rc.getInt("pack", //$NON-NLS-1$ setBitmapExcessiveBranchCount(rc.getInt(CONFIG_PACK_SECTION,
"bitmapexcessivebranchcount", getBitmapExcessiveBranchCount())); //$NON-NLS-1$ CONFIG_KEY_BITMAP_EXCESSIVE_BRANCH_COUNT,
setBitmapInactiveBranchAgeInDays( getBitmapExcessiveBranchCount()));
rc.getInt("pack", "bitmapinactivebranchageindays", //$NON-NLS-1$ //$NON-NLS-2$ setBitmapInactiveBranchAgeInDays(rc.getInt(CONFIG_PACK_SECTION,
CONFIG_KEY_BITMAP_INACTIVE_BRANCH_AGE_INDAYS,
getBitmapInactiveBranchAgeInDays())); getBitmapInactiveBranchAgeInDays()));
setWaitPreventRacyPack(rc.getBoolean("pack", "waitpreventracypack", //$NON-NLS-1$ //$NON-NLS-2$ setWaitPreventRacyPack(rc.getBoolean(CONFIG_PACK_SECTION,
isWaitPreventRacyPack())); CONFIG_KEY_WAIT_PREVENT_RACYPACK, isWaitPreventRacyPack()));
setMinSizePreventRacyPack(rc.getLong("pack", "minsizepreventracypack", //$NON-NLS-1$//$NON-NLS-2$ setMinSizePreventRacyPack(rc.getLong(CONFIG_PACK_SECTION,
CONFIG_KEY_MIN_SIZE_PREVENT_RACYPACK,
getMinSizePreventRacyPack())); getMinSizePreventRacyPack()));
} }

Loading…
Cancel
Save