- java.lang.Object
-
- org.eclipse.jgit.lib.RepositoryCacheConfig
-
public class RepositoryCacheConfig extends Object
Configuration parameters for JVM-wide repository cache used by JGit.- Since:
- 4.4
-
-
Field Summary
Fields Modifier and Type Field Description static longAUTO_CLEANUP_DELAYSet cleanupDelayMillis to this value in order to auto-set it to minimum of 1/10 of expireAfterMillis and 10 minutesstatic longNO_CLEANUPSet cleanupDelayMillis to this value in order to switch off time-based cache eviction.
-
Constructor Summary
Constructors Constructor Description RepositoryCacheConfig()Create a default configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RepositoryCacheConfigfromConfig(Config config)Update properties by setting fields from the configuration.longgetCleanupDelay()Get the delay between the periodic cleanup of expired repository in milliseconds.longgetExpireAfter()Get the time an unused repository should be expired and be evicted from the RepositoryCache in milliseconds.voidinstall()Install this configuration as the live settings.voidsetCleanupDelay(long cleanupDelayMillis)Set the delay between the periodic cleanup of expired repository in milliseconds.voidsetExpireAfter(long expireAfterMillis)Set the time an unused repository should be expired and be evicted from the RepositoryCache in milliseconds.
-
-
-
Field Detail
-
NO_CLEANUP
public static final long NO_CLEANUP
Set cleanupDelayMillis to this value in order to switch off time-based cache eviction. Expired cache entries will only be evicted when RepositoryCache.clearExpired or RepositoryCache.clear are called.- See Also:
- Constant Field Values
-
AUTO_CLEANUP_DELAY
public static final long AUTO_CLEANUP_DELAY
Set cleanupDelayMillis to this value in order to auto-set it to minimum of 1/10 of expireAfterMillis and 10 minutes- See Also:
- Constant Field Values
-
-
Method Detail
-
getExpireAfter
public long getExpireAfter()
Get the time an unused repository should be expired and be evicted from the RepositoryCache in milliseconds.- Returns:
- the time an unused repository should be expired and be evicted from the RepositoryCache in milliseconds. Default is 1 hour.
-
setExpireAfter
public void setExpireAfter(long expireAfterMillis)
Set the time an unused repository should be expired and be evicted from the RepositoryCache in milliseconds.- Parameters:
expireAfterMillis- the time an unused repository should be expired and be evicted from the RepositoryCache in milliseconds.
-
getCleanupDelay
public long getCleanupDelay()
Get the delay between the periodic cleanup of expired repository in milliseconds.- Returns:
- the delay between the periodic cleanup of expired repository in milliseconds. Default is minimum of 1/10 of expireAfterMillis and 10 minutes
-
setCleanupDelay
public void setCleanupDelay(long cleanupDelayMillis)
Set the delay between the periodic cleanup of expired repository in milliseconds.- Parameters:
cleanupDelayMillis- the delay between the periodic cleanup of expired repository in milliseconds. Set it toAUTO_CLEANUP_DELAYto automatically derive cleanup delay from expireAfterMillis.Set it to
NO_CLEANUPin order to switch off cache expiration.If cache expiration is switched off the JVM still can evict cache entries when the JVM is running low on available heap memory.
-
fromConfig
public RepositoryCacheConfig fromConfig(Config config)
Update properties by setting fields from the configuration.If a property is not defined in the configuration, then it is left unmodified.
- Parameters:
config- configuration to read properties from.- Returns:
this.
-
install
public void install()
Install this configuration as the live settings.The new configuration is applied immediately.
-
-