public final class BlobLibraryCacheManager extends TimerTask implements LibraryCacheManager
This class is thread-safe.
| Constructor and Description |
|---|
BlobLibraryCacheManager(BlobService blobService,
Configuration configuration) |
| Modifier and Type | Method and Description |
|---|---|
int |
getBlobServerPort() |
ClassLoader |
getClassLoader(JobID id)
Returns the class loader to the specified vertex.
|
File |
getFile(BlobKey blobKey)
Returns a file handle to the file identified by the blob key.
|
void |
register(JobID id,
Collection<BlobKey> requiredJarFiles)
Registers a job ID with a set of library paths that are required to run the job.
|
void |
run()
Cleans up blobs which are not referenced anymore
|
void |
shutdown()
Shutdown method
|
void |
unregister(JobID id)
Unregisters a job ID and releases the resources associated with it.
|
cancel, scheduledExecutionTimepublic BlobLibraryCacheManager(BlobService blobService, Configuration configuration)
public void register(JobID id, Collection<BlobKey> requiredJarFiles) throws IOException
register in interface LibraryCacheManagerid - the ID of the job to be registered.requiredJarFiles - the client path's of the required librariesIOException - thrown if one of the requested libraries is not in the cachepublic void unregister(JobID id)
unregister in interface LibraryCacheManagerid - the job ID to unregisterpublic ClassLoader getClassLoader(JobID id)
getClassLoader in interface LibraryCacheManagerid - the ID of the job to return the class loader fornull if no class loader has been registered with the
given ID.public File getFile(BlobKey blobKey) throws IOException
LibraryCacheManagergetFile in interface LibraryCacheManagerblobKey - identifying the requested fileIOExceptionpublic int getBlobServerPort()
public void shutdown()
throws IOException
LibraryCacheManagershutdown in interface LibraryCacheManagerIOExceptionCopyright © 2014 The Apache Software Foundation. All rights reserved.