Interface FunctionCacheManager

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
FunctionCacheManagerImpl

public interface FunctionCacheManager extends AutoCloseable
A cache manager for caching function code and its dependencies.
  • Method Details

    • getClassLoader

      ClassLoader getClassLoader(String fid)
      Returns the function code class loader associated with id.
      Parameters:
      fid - function id
      Returns:
      class loader which can load the function code.
    • registerFunction

      default void registerFunction(String fid, List<String> requiredJarFiles, List<URL> requiredClasspaths) throws IOException
      Registers a function with its required jar files and classpaths.

      The jar files are identified by their blob keys and downloaded for use by a ClassLoader.

      Parameters:
      fid - function id
      requiredJarFiles - collection of blob keys identifying the required jar files.
      requiredClasspaths - collection of classpaths that are added to the function code class loader.
      Throws:
      IOException
    • registerFunctionInstance

      void registerFunctionInstance(String fid, String eid, List<String> requiredJarFiles, List<URL> requiredClasspaths) throws IOException
      Throws:
      IOException
    • registerFunctionInstanceWithArchive

      void registerFunctionInstanceWithArchive(String fid, String eid, String narArchive, String narExtractionDirectory) throws IOException
      Throws:
      IOException
    • unregisterFunction

      default void unregisterFunction(String fid)
      Unregisters a job from the function cache manager.
      Parameters:
      fid - function id
    • unregisterFunctionInstance

      void unregisterFunctionInstance(String fid, String eid)
    • close

      void close()
      Close the cache manager to release created class loaders.
      Specified by:
      close in interface AutoCloseable