Top Description Fields Constructors Methods
org.eclipse.jgit.lib

public Class RepositoryCacheConfig

extends Object
Class Inheritance
Imports
java.util.concurrent.TimeUnit

Configuration parameters for JVM-wide repository cache used by JGit.
Since
4.4

Field Summary

Modifier and TypeField and Description
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

private long
private long
public static final long
NO_CLEANUP

Set cleanupDelayMillis to this value in order to switch off time-based cache eviction.

Constructor Summary

AccessConstructor and Description
public
RepositoryCacheConfig()

Create a default configuration.

Method Summary

Modifier and TypeMethod and Description
public RepositoryCacheConfig

Returns:

this.
fromConfig
(Config
configuration to read properties from.
config
)

Update properties by setting fields from the configuration.

public long

Returns:

the delay between the periodic cleanup of expired repository in milliseconds. Default is minimum of 1/10 of expireAfterMillis and 10 minutes
getCleanupDelay
()

Get the delay between the periodic cleanup of expired repository in milliseconds.

public long

Returns:

the time an unused repository should be expired and be evicted from the RepositoryCache in milliseconds. Default is 1 hour.
getExpireAfter
()

Get the time an unused repository should be expired and be evicted from the RepositoryCache in milliseconds.

public void
install()

Install this configuration as the live settings.

public void
setCleanupDelay(long
the delay between the periodic cleanup of expired repository in milliseconds. Set it to AUTO_CLEANUP_DELAY to automatically derive cleanup delay from expireAfterMillis.

Set it to NO_CLEANUP in 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.

cleanupDelayMillis
)

Set the delay between the periodic cleanup of expired repository in milliseconds.

public void
setExpireAfter(long
the time an unused repository should be expired and be evicted from the RepositoryCache in milliseconds.
expireAfterMillis
)

Set the time an unused repository should be expired and be evicted from the RepositoryCache in milliseconds.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

AUTO_CLEANUP_DELAYback to summary
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

cleanupDelayMillisback to summary
private long cleanupDelayMillis
expireAfterMillisback to summary
private long expireAfterMillis
NO_CLEANUPback to summary
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.

Constructor Detail

RepositoryCacheConfigback to summary
public RepositoryCacheConfig()

Create a default configuration.

Method Detail

fromConfigback to summary
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:Config

configuration to read properties from.

Returns:RepositoryCacheConfig

this.

getCleanupDelayback to summary
public long getCleanupDelay()

Get the delay between the periodic cleanup of expired repository in milliseconds.

Returns:long

the delay between the periodic cleanup of expired repository in milliseconds. Default is minimum of 1/10 of expireAfterMillis and 10 minutes

getExpireAfterback to summary
public long getExpireAfter()

Get the time an unused repository should be expired and be evicted from the RepositoryCache in milliseconds.

Returns:long

the time an unused repository should be expired and be evicted from the RepositoryCache in milliseconds. Default is 1 hour.

installback to summary
public void install()

Install this configuration as the live settings.

The new configuration is applied immediately.

setCleanupDelayback to summary
public void setCleanupDelay(long cleanupDelayMillis)

Set the delay between the periodic cleanup of expired repository in milliseconds.

Parameters
cleanupDelayMillis:long

the delay between the periodic cleanup of expired repository in milliseconds. Set it to AUTO_CLEANUP_DELAY to automatically derive cleanup delay from expireAfterMillis.

Set it to NO_CLEANUP in 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.

setExpireAfterback to summary
public void setExpireAfter(long expireAfterMillis)

Set the time an unused repository should be expired and be evicted from the RepositoryCache in milliseconds.

Parameters
expireAfterMillis:long

the time an unused repository should be expired and be evicted from the RepositoryCache in milliseconds.