@NotThreadSafe public abstract class AbstractLocalAlluxioCluster extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
mHostname |
protected ProxyProcess |
mProxyProcess |
protected Thread |
mProxyThread |
protected String |
mWorkDirectory |
protected List<WorkerProcess> |
mWorkers |
protected List<Thread> |
mWorkerThreads |
| Modifier and Type | Method and Description |
|---|---|
void |
formatAndRestartMasters()
Stops the masters, formats them, and then restarts them.
|
abstract FileSystem |
getClient()
Returns a
FileSystem client. |
abstract FileSystem |
getClient(FileSystemContext context) |
protected abstract LocalAlluxioMaster |
getLocalAlluxioMaster() |
ProxyProcess |
getProxyProcess()
Gets the proxy process.
|
abstract void |
initConfiguration()
Creates a default
ServerConfiguration for testing. |
protected void |
reset()
Resets the cluster to original state.
|
protected void |
resetClientPools()
Resets the client pools to the original state.
|
void |
restartMasters()
Restarts the master(s).
|
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 |
startMasters()
Configures and starts the master(s).
|
void |
startWorkers()
Configures and starts the worker(s).
|
void |
stop()
Stops both the alluxio and underfs service threads.
|
void |
stopFS()
Stops the alluxio filesystem's service thread only.
|
protected abstract void |
stopMasters()
Stops the masters.
|
protected void |
stopProxy()
Stops the proxy.
|
void |
stopWorkers()
Stops the workers.
|
void |
waitForWorkersRegistered(int timeoutMs)
Waits for all workers registered with master.
|
protected ProxyProcess mProxyProcess
protected Thread mProxyThread
protected List<WorkerProcess> mWorkers
protected String mWorkDirectory
protected String mHostname
public void start()
throws Exception
Exceptionprotected abstract void startMasters()
throws Exception
Exceptionpublic void restartMasters()
throws Exception
Exceptionpublic void startWorkers()
throws Exception
Exceptionprotected void setupTest()
throws IOException
IOExceptionpublic void stop()
throws Exception
Exceptionpublic void stopFS()
throws Exception
Exceptionpublic void formatAndRestartMasters()
throws Exception
Exceptionprotected abstract void stopMasters()
throws Exception
Exceptionpublic abstract void initConfiguration()
throws IOException
ServerConfiguration for testing.IOExceptionpublic abstract FileSystem getClient() throws IOException
FileSystem client.FileSystem clientIOExceptionpublic abstract FileSystem getClient(FileSystemContext context) throws IOException
context - the FileSystemContext to useFileSystem client, using a specific contextIOExceptionprotected abstract LocalAlluxioMaster getLocalAlluxioMaster()
public ProxyProcess getProxyProcess()
public void waitForWorkersRegistered(int timeoutMs)
throws TimeoutException,
InterruptedException,
IOException
timeoutMs - the timeout to waitTimeoutExceptionInterruptedExceptionIOExceptionprotected void reset()
protected void resetClientPools()
throws IOException
IOExceptionprotected void setHostname()
protected void setAlluxioWorkDirectory()
Copyright © 2019. All Rights Reserved.