Class 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 Detail

      • Saver

        public Saver()
    • 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 cache
        build - The build in progress
        workspace - The executor workspace
        launcher - The launcher
        listener - The task listener
        Returns:
        The size in bytes of the remote cache
        Throws:
        IOException - If an error occurs connecting to the potentially remote executor
        InterruptedException - 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 within
        build - The build in progress
        workspace - The executor workspace
        launcher - The launcher
        listener - The task listener
        Throws:
        IOException - If an error occurs connecting to the potentially remote executor
        InterruptedException - If interrupted