Interface FunctionCacheManager
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
FunctionCacheManagerImpl
A cache manager for caching function code and its dependencies.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the cache manager to release created class loaders.getClassLoader(String fid) Returns the function code class loader associated with id.default voidRegisters a function with its required jar files and classpaths.voidregisterFunctionInstance(String fid, String eid, List<String> requiredJarFiles, List<URL> requiredClasspaths) voidregisterFunctionInstanceWithArchive(String fid, String eid, String narArchive, String narExtractionDirectory) default voidunregisterFunction(String fid) Unregisters a job from the function cache manager.voidunregisterFunctionInstance(String fid, String eid)
-
Method Details
-
getClassLoader
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 idrequiredJarFiles- 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
Unregisters a job from the function cache manager.- Parameters:
fid- function id
-
unregisterFunctionInstance
-
close
void close()Close the cache manager to release created class loaders.- Specified by:
closein interfaceAutoCloseable
-