@NotThreadSafe public abstract class AbstractLocalAlluxioCluster extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOG |
protected String |
mHostname |
protected UnderFileSystemCluster |
mUfsCluster |
protected String |
mWorkDirectory |
protected List<AlluxioWorkerService> |
mWorkers |
| Constructor and Description |
|---|
AbstractLocalAlluxioCluster(int numWorkers) |
| 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.
|
void |
initConfiguration()
Creates a default
Configuration for testing. |
protected void |
reset()
Resets the cluster to original state.
|
protected void |
runWorkers()
Runs workers.
|
protected void |
setAlluxioWorkDirectory()
Sets Alluxio work directory.
|
protected void |
setHostname()
Sets hostname.
|
protected void |
setupTest()
Sets up corresponding directories for tests.
|
void |
start()
Starts both master and a worker using the configurations in test conf respectively.
|
protected abstract void |
startMaster()
Configures and starts a master.
|
protected abstract void |
startWorkers()
Configures and starts the workers.
|
void |
stop()
Stops both the alluxio and underfs service threads.
|
abstract void |
stopFS()
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 List<AlluxioWorkerService> mWorkers
protected UnderFileSystemCluster mUfsCluster
protected String mWorkDirectory
protected String mHostname
public AbstractLocalAlluxioCluster(int numWorkers)
numWorkers - the number of workers to runpublic void start()
throws IOException,
ConnectionFailedException
IOException - if an I/O error occursConnectionFailedException - if network connection failedprotected abstract void startMaster()
throws IOException
IOException - when the operation failsprotected abstract void startWorkers()
throws IOException,
ConnectionFailedException
IOException - if an I/O error occursConnectionFailedException - if network connection failedprotected void setupTest()
throws IOException
IOException - when creating or deleting dirs failedpublic void stop()
throws Exception
Exception - when the operation failspublic abstract void stopFS()
throws Exception
Exception - when the operation failsprotected void stopUFS()
throws Exception
Exception - when the operation failspublic void initConfiguration()
throws IOException
Configuration for testing.IOException - when the operation failsprotected void runWorkers()
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()
protected void reset()
protected void setHostname()
protected void setAlluxioWorkDirectory()
Copyright © 2016. All Rights Reserved.