public class BlobServer extends Thread implements BlobService
Thread.State, Thread.UncaughtExceptionHandler
MAX_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 key)
This method deletes the file associated to the blob key if it exists in the local storage
of the blob server.
|
int |
getPort()
Returns the port on which the server is listening.
|
URL |
getURL(BlobKey requiredBlob)
Method which retrieves the URL of a file associated with a blob key.
|
boolean |
isShutdown()
Tests whether the BLOB server has been requested to shut down.
|
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, yield
public BlobServer(Configuration config) throws IOException
IOException
- thrown if the BLOB server cannot bind to a free network portpublic void shutdown()
shutdown
in interface BlobService
public URL getURL(BlobKey requiredBlob) throws IOException
getURL
in interface BlobService
requiredBlob
- blob key associated with the requested fileIOException
public void delete(BlobKey key) throws IOException
delete
in interface BlobService
key
- associated with the file to be deletedIOException
public int getPort()
getPort
in interface BlobService
public boolean isShutdown()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.