Package jenkins.plugins.jobcacher
Class Cache.Saver
- java.lang.Object
-
- jenkins.plugins.jobcacher.Cache.Saver
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- Cache
public abstract static class Cache.Saver extends Object implements Serializable
Class that is used to save the cache on the remote system back to the cache storage system.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Saver()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract 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, Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener)
Saves the files from the executor to the cache storage system.
-
-
-
Method Detail
-
calculateSize
public abstract long calculateSize(ObjectPath cache, Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
Calculates 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, Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
Saves the files from the executor to the cache storage system.- Parameters:
cache
- The root of the cache where savers should store their cache withinbuild
- 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
-
-