public class BlobLibraryCacheManager extends Object implements LibraryCacheManager
PermanentBlobService
and create a class loader with references to them.Constructor and Description |
---|
BlobLibraryCacheManager(PermanentBlobService blobService,
FlinkUserCodeClassLoaders.ResolveOrder classLoaderResolveOrder,
String[] alwaysParentFirstPatterns) |
BlobLibraryCacheManager(PermanentBlobService blobService,
FlinkUserCodeClassLoaders.ResolveOrder classLoaderResolveOrder,
String[] alwaysParentFirstPatterns,
FatalErrorHandler fatalErrorHandler) |
Modifier and Type | Method and Description |
---|---|
ClassLoader |
getClassLoader(JobID jobId)
Returns the user code class loader associated with id.
|
boolean |
hasClassLoader(JobID jobId)
True if the LibraryCacheManager has a user code class loader registered
for the given job id.
|
void |
registerJob(JobID id,
Collection<PermanentBlobKey> requiredJarFiles,
Collection<URL> requiredClasspaths)
Registers a job with its required jar files and classpaths.
|
void |
registerTask(JobID jobId,
ExecutionAttemptID task,
Collection<PermanentBlobKey> requiredJarFiles,
Collection<URL> requiredClasspaths)
Registers a job task execution with its required jar files and classpaths.
|
void |
shutdown()
Shutdown method which may release created class loaders.
|
void |
unregisterJob(JobID id)
Unregisters a job from the library cache manager.
|
void |
unregisterTask(JobID jobId,
ExecutionAttemptID task)
Unregisters a job task execution from the library cache manager.
|
public BlobLibraryCacheManager(PermanentBlobService blobService, FlinkUserCodeClassLoaders.ResolveOrder classLoaderResolveOrder, String[] alwaysParentFirstPatterns, @Nullable FatalErrorHandler fatalErrorHandler)
@VisibleForTesting public BlobLibraryCacheManager(PermanentBlobService blobService, FlinkUserCodeClassLoaders.ResolveOrder classLoaderResolveOrder, String[] alwaysParentFirstPatterns)
public void registerJob(JobID id, Collection<PermanentBlobKey> requiredJarFiles, Collection<URL> requiredClasspaths) throws IOException
LibraryCacheManager
ClassLoader
.registerJob
in interface LibraryCacheManager
id
- job IDrequiredJarFiles
- collection of blob keys identifying the required jar filesrequiredClasspaths
- collection of classpaths that are added to the user code class loaderIOException
- if any error occurs when retrieving the required jar filescounterpart of this method
public void registerTask(JobID jobId, ExecutionAttemptID task, @Nullable Collection<PermanentBlobKey> requiredJarFiles, @Nullable Collection<URL> requiredClasspaths) throws IOException
LibraryCacheManager
ClassLoader
.registerTask
in interface LibraryCacheManager
jobId
- job IDrequiredJarFiles
- collection of blob keys identifying the required jar filesrequiredClasspaths
- collection of classpaths that are added to the user code class loaderIOException
- if any error occurs when retrieving the required jar filescounterpart of this method
public void unregisterJob(JobID id)
LibraryCacheManager
Note: this is the counterpart of LibraryCacheManager.registerJob(JobID, Collection,
Collection)
and it will not remove any job task execution added via LibraryCacheManager.registerTask(JobID, ExecutionAttemptID, Collection, Collection)
!
unregisterJob
in interface LibraryCacheManager
id
- job IDcounterpart of this method
public void unregisterTask(JobID jobId, ExecutionAttemptID task)
LibraryCacheManager
Note: this is the counterpart of LibraryCacheManager.registerTask(JobID,
ExecutionAttemptID, Collection, Collection)
and it will not remove any job added via
LibraryCacheManager.registerJob(JobID, Collection, Collection)
!
unregisterTask
in interface LibraryCacheManager
jobId
- job IDcounterpart of this method
public ClassLoader getClassLoader(JobID jobId)
LibraryCacheManager
getClassLoader
in interface LibraryCacheManager
jobId
- identifying the jobpublic void shutdown()
LibraryCacheManager
shutdown
in interface LibraryCacheManager
public boolean hasClassLoader(@Nonnull JobID jobId)
LibraryCacheManager
hasClassLoader
in interface LibraryCacheManager
jobId
- identifying the job for which to check the class loaderCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.