public final class BlobLibraryCacheManager extends TimerTask implements LibraryCacheManager
Constructor and Description |
---|
BlobLibraryCacheManager(BlobService blobService,
long cleanupInterval) |
Modifier and Type | Method and Description |
---|---|
int |
getBlobServerPort() |
ClassLoader |
getClassLoader(JobID id)
Returns the user code class loader associated with id.
|
File |
getFile(BlobKey blobKey)
Returns a file handle to the file identified by the blob key.
|
int |
getNumberOfReferenceHolders(JobID jobId) |
void |
registerJob(JobID id,
Collection<BlobKey> requiredJarFiles,
Collection<URL> requiredClasspaths)
Registers a job with its required jar files and classpaths.
|
void |
registerTask(JobID jobId,
ExecutionAttemptID task,
Collection<BlobKey> requiredJarFiles,
Collection<URL> requiredClasspaths)
Registers a job task execution with its required jar files and classpaths.
|
void |
run()
Cleans up blobs which are not referenced anymore
|
void |
shutdown()
Shutdown method
|
void |
unregisterJob(JobID id)
Unregisters a job from the library cache manager.
|
void |
unregisterTask(JobID jobId,
ExecutionAttemptID task)
Unregisters a job from the library cache manager.
|
cancel, scheduledExecutionTime
public BlobLibraryCacheManager(BlobService blobService, long cleanupInterval)
public void registerJob(JobID id, Collection<BlobKey> requiredJarFiles, Collection<URL> requiredClasspaths) throws IOException
LibraryCacheManager
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
public void registerTask(JobID jobId, ExecutionAttemptID task, Collection<BlobKey> requiredJarFiles, Collection<URL> requiredClasspaths) throws IOException
LibraryCacheManager
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
public void unregisterJob(JobID id)
LibraryCacheManager
unregisterJob
in interface LibraryCacheManager
id
- job IDpublic void unregisterTask(JobID jobId, ExecutionAttemptID task)
LibraryCacheManager
unregisterTask
in interface LibraryCacheManager
jobId
- job IDpublic ClassLoader getClassLoader(JobID id)
LibraryCacheManager
getClassLoader
in interface LibraryCacheManager
id
- identifying the jobpublic File getFile(BlobKey blobKey) throws IOException
LibraryCacheManager
getFile
in interface LibraryCacheManager
blobKey
- identifying the requested fileIOException
public int getBlobServerPort()
public void shutdown() throws IOException
LibraryCacheManager
shutdown
in interface LibraryCacheManager
IOException
public void run()
public int getNumberOfReferenceHolders(JobID jobId)
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.