Class GeneratedSettingsCache
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.versionedSettings.GeneratedSettingsCache
-
- All Implemented Interfaces:
AfterBuildsCleanupExtension,ServerExtension,TeamCityExtension
public class GeneratedSettingsCache extends Object implements AfterBuildsCleanupExtension
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGeneratedSettingsCache.CacheKeystatic classGeneratedSettingsCache.Result
-
Constructor Summary
Constructors Constructor Description GeneratedSettingsCache(ServerPaths paths, ExtensionHolder extensionHolder, ExecutorServices executorServices, TimeService timeService, ResetCacheRegister resetCacheRegister)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterCleanup(CleanupProcessState cleanupState)Invoked upon finishing of the main cleanup process.voidcleanup(long vcsRootInstanceId, boolean async)GeneratedSettingsCache.ResultgetAndLock(GeneratedSettingsCache.CacheKey cacheKey, Consumer<GeneratedSettingsCache.Result> consumer)Generate settings and return the directory with the result or take it from cache if already generated.protected static voidstoreLastAccessTimes(Map<String,Long> lastAccessTimes, File lastAccessTimesFile)voidunlock(File cacheDir)
-
-
-
Constructor Detail
-
GeneratedSettingsCache
public GeneratedSettingsCache(@NotNull ServerPaths paths, @NotNull ExtensionHolder extensionHolder, @NotNull ExecutorServices executorServices, @NotNull TimeService timeService, @NotNull ResetCacheRegister resetCacheRegister)
-
-
Method Detail
-
getAndLock
@NotNull public GeneratedSettingsCache.Result getAndLock(@NotNull GeneratedSettingsCache.CacheKey cacheKey, @NotNull Consumer<GeneratedSettingsCache.Result> consumer)
Generate settings and return the directory with the result or take it from cache if already generated. The returned directory is locked, i.e. it's guaranteed that it won't be modified until theunlock(File)is called. Don't forget to call theunlock(File)when you are done with the returned directory.
-
unlock
public void unlock(@NotNull File cacheDir)
-
cleanup
public void cleanup(long vcsRootInstanceId, boolean async)
-
storeLastAccessTimes
protected static void storeLastAccessTimes(Map<String,Long> lastAccessTimes, File lastAccessTimesFile)
-
afterCleanup
public void afterCleanup(@NotNull CleanupProcessState cleanupState)Description copied from interface:AfterBuildsCleanupExtensionInvoked upon finishing of the main cleanup process. At this point all data for specific builds is deleted.
Note: This extension might not be called for every cleanup run as cleanup process can be interrupted earlier. Extension must check cleanup process state and if it is interrupted, complete its operations and return as quick as possible.- Specified by:
afterCleanupin interfaceAfterBuildsCleanupExtension- Parameters:
cleanupState- cleanup process state
-
-