@NotThreadSafe public abstract class AbstractLocalAlluxioCluster extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOG |
protected String |
mHome |
protected String |
mHostname |
protected Configuration |
mMasterConf |
protected UnderFileSystemCluster |
mUfsCluster |
protected int |
mUserBlockSize |
protected AlluxioWorker |
mWorker |
protected long |
mWorkerCapacityBytes |
protected Configuration |
mWorkerConf |
protected Thread |
mWorkerThread |
| Constructor and Description |
|---|
AbstractLocalAlluxioCluster(long workerCapacityBytes,
int userBlockSize) |
| Modifier and Type | Method and Description |
|---|---|
abstract FileSystem |
getClient()
Returns a
FileSystem client. |
protected abstract LocalAlluxioMaster |
getMaster()
Gets the master which should be listening for RPC and Web requests.
|
Configuration |
getMasterConf() |
Configuration |
newTestConf()
Creates a default
Configuration for testing. |
protected void |
resetContext()
Resets contexts.
|
protected void |
runWorker()
Runs a worker.
|
protected void |
setAlluxioHome()
Sets alluxio home.
|
protected void |
setHostname()
Sets hostname.
|
protected void |
setupTest(Configuration conf)
Sets up corresponding directories for tests.
|
void |
start()
Starts both a master and a worker using the default test configurations.
|
void |
start(Configuration conf)
Starts both master and a worker using the configurations in test conf respectively.
|
protected abstract void |
startMaster(Configuration conf)
Configures and starts a master.
|
protected abstract void |
startWorker(Configuration conf)
Configures and starts a worker.
|
void |
stop()
Stops both the alluxio and underfs service threads.
|
abstract void |
stopTFS()
Stops the alluxio filesystem's service thread only.
|
protected void |
stopUFS()
Cleans up the underfs cluster test folder only.
|
protected static final org.slf4j.Logger LOG
protected long mWorkerCapacityBytes
protected int mUserBlockSize
protected Configuration mMasterConf
protected Configuration mWorkerConf
protected AlluxioWorker mWorker
protected UnderFileSystemCluster mUfsCluster
protected String mHome
protected String mHostname
protected Thread mWorkerThread
public AbstractLocalAlluxioCluster(long workerCapacityBytes,
int userBlockSize)
workerCapacityBytes - the capacity of the worker in bytesuserBlockSize - the block size for a userpublic void start()
throws IOException,
ConnectionFailedException
IOException - if an I/O error occursConnectionFailedException - if network connection failedpublic void start(Configuration conf) throws IOException, ConnectionFailedException
conf - the configuration for AlluxioIOException - if an I/O error occursConnectionFailedException - if network connection failedprotected abstract void startMaster(Configuration conf) throws IOException
conf - configuration of this testIOException - when the operation failsprotected abstract void startWorker(Configuration conf) throws IOException, ConnectionFailedException
conf - configuration of this testIOException - if an I/O error occursConnectionFailedException - if network connection failedprotected void setupTest(Configuration conf) throws IOException
conf - configuration of this testIOException - when creating or deleting dirs failedpublic void stop()
throws Exception
Exception - when the operation failspublic abstract void stopTFS()
throws Exception
Exception - when the operation failsprotected void stopUFS()
throws Exception
Exception - when the operation failspublic Configuration newTestConf() throws IOException
Configuration for testing.IOException - when the operation failsprotected void runWorker()
throws IOException,
ConnectionFailedException
IOException - if an I/O error occursConnectionFailedException - if network connection failedpublic abstract FileSystem getClient() throws IOException
FileSystem client.FileSystem clientIOException - when the operation failsprotected abstract LocalAlluxioMaster getMaster()
public Configuration getMasterConf()
Configurationprotected void resetContext()
protected void setHostname()
protected void setAlluxioHome()
throws IOException
IOException - when the operation failsCopyright © 2016. All Rights Reserved.