public class BlobServer extends Thread implements BlobService
Thread.State, Thread.UncaughtExceptionHandler
MAX_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, yield
public 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 Closeable
close
in interface AutoCloseable
IOException
public BlobClient createClient() throws IOException
createClient
in interface BlobService
IOException
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–2018 The Apache Software Foundation. All rights reserved.