Package jenkins.plugins.jobcacher
Class Cache.Saver
java.lang.Object
jenkins.plugins.jobcacher.Cache.Saver
- All Implemented Interfaces:
Serializable
- Enclosing class:
- Cache
Class that is used to save the cache on the remote system back to the cache storage system.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract long
calculateSize
(ObjectPath cache, Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) Calculates the size of the cache on the executor.abstract void
save
(ObjectPath cache, ObjectPath defaultCache, Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) Saves the files from the executor to the cache storage system.
-
Constructor Details
-
Saver
public Saver()
-
-
Method Details
-
calculateSize
public abstract long calculateSize(ObjectPath cache, Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedExceptionCalculates the size of the cache on the executor. It will be used to determine if the total size of the cache if returned to the cache storage system would be greater than the configured maximum cache size.- Parameters:
cache
- The root of the cachebuild
- The build in progressworkspace
- The executor workspacelauncher
- The launcherlistener
- The task listener- Returns:
- The size in bytes of the remote cache
- Throws:
IOException
- If an error occurs connecting to the potentially remote executorInterruptedException
- If interrupted
-
save
public abstract void save(ObjectPath cache, ObjectPath defaultCache, Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedExceptionSaves the files from the executor to the cache storage system.- Parameters:
cache
- The root of the cache where savers should store their cache withindefaultCache
- The root of the alternate default object cachebuild
- The build in progressworkspace
- The executor workspacelauncher
- The launcherlistener
- The task listener- Throws:
IOException
- If an error occurs connecting to the potentially remote executorInterruptedException
- If interrupted
-