public final class BlobServer extends Thread implements BlobService
Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
BlobServer(Configuration config)
Instantiates a new BLOB server and binds it to a free network port.
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete(BlobKey blobKey)
This method deletes the file associated to the blob key if it exists in the local storage
of the blob server.
|
void |
deleteJobDirectory(JobID jobID)
Method which deletes all files associated with the given jobID.
|
int |
getPort()
Returns the port on which the server is listening.
|
int |
getServerPort()
Returns the network port the BLOB server is bound to.
|
File |
getStorageLocation(BlobKey key)
Returns a file handle to the file associated with the given blob key on the blob
server.
|
File |
getStorageLocation(JobID jobID,
String key)
Returns a file handle to the file identified by the given jobID and key.
|
URL |
getURL(BlobKey requiredBlob)
Method which retrieves the URL of a file associated with a blob key.
|
void |
run() |
void |
shutdown()
Shuts down the BLOB server.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic BlobServer(Configuration config) throws IOException
IOException - thrown if the BLOB server cannot bind to a free network portpublic int getServerPort()
public File getStorageLocation(BlobKey key)
key - identifying the filepublic File getStorageLocation(JobID jobID, String key)
jobID - to which the file is associatedkey - to identify the file within the job contextpublic void deleteJobDirectory(JobID jobID) throws IOException
jobID - all files associated to this jobID will be deletedIOExceptionpublic void shutdown()
shutdown in interface BlobServicepublic URL getURL(BlobKey requiredBlob) throws IOException
getURL in interface BlobServicerequiredBlob - blob key associated with the requested fileIOExceptionpublic void delete(BlobKey blobKey) throws IOException
delete in interface BlobServiceblobKey - associated with the file to be deletedIOExceptionpublic int getPort()
getPort in interface BlobServiceCopyright © 2015 The Apache Software Foundation. All rights reserved.