public class BlobServer extends Thread implements BlobService
Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
BlobServer(Configuration config,
BlobStore blobStore)
Instantiates a new BLOB server and binds it to a free network port.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Shuts down the BLOB server.
|
BlobClient |
createClient() |
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.
|
ReadWriteLock |
getReadWriteLock()
Returns the lock used to guard file accesses
|
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() |
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, BlobStore blobStore) throws IOException
config - Configuration to be used to instantiate the BlobServerblobStore - BlobStore to store blobs persistentlyIOException - thrown if the BLOB server cannot bind to a free network port or if the
(local or distributed) file storage cannot be created or is not usablepublic ReadWriteLock getReadWriteLock()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic BlobClient createClient() throws IOException
createClient in interface BlobServiceIOExceptionpublic URL getURL(BlobKey requiredBlob) throws IOException
getURL in interface BlobServicerequiredBlob - blob key associated with the requested fileIOExceptionpublic void delete(BlobKey key) throws IOException
delete in interface BlobServicekey - associated with the file to be deletedIOExceptionpublic int getPort()
getPort in interface BlobServicepublic boolean isShutdown()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.