@NotThreadSafe
public abstract class AbstractLocalAlluxioCluster
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
mHostname |
protected ProxyProcess |
mProxyProcess |
protected java.lang.Thread |
mProxyThread |
protected java.lang.String |
mWorkDirectory |
protected java.util.List<WorkerProcess> |
mWorkers |
protected java.util.List<java.lang.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(java.lang.String name)
Creates a default
ServerConfiguration for testing. |
boolean |
isStartedWorkers() |
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(java.lang.String name)
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 java.lang.Thread mProxyThread
protected java.util.List<WorkerProcess> mWorkers
protected java.util.List<java.lang.Thread> mWorkerThreads
protected java.lang.String mWorkDirectory
protected java.lang.String mHostname
public void start()
throws java.lang.Exception
java.lang.Exceptionprotected abstract void startMasters()
throws java.lang.Exception
java.lang.Exceptionpublic void restartMasters()
throws java.lang.Exception
java.lang.Exceptionpublic void startWorkers()
throws java.lang.Exception
java.lang.Exceptionprotected void setupTest()
throws java.io.IOException
java.io.IOExceptionpublic void stop()
throws java.lang.Exception
java.lang.Exceptionpublic void stopFS()
throws java.lang.Exception
java.lang.Exceptionpublic void formatAndRestartMasters()
throws java.lang.Exception
java.lang.Exceptionprotected abstract void stopMasters()
throws java.lang.Exception
java.lang.Exceptionprotected void stopProxy()
throws java.lang.Exception
java.lang.Exceptionpublic void stopWorkers()
throws java.lang.Exception
java.lang.Exceptionpublic boolean isStartedWorkers()
public abstract void initConfiguration(java.lang.String name)
throws java.io.IOException
ServerConfiguration for testing.name - the name of the test/clusterjava.io.IOExceptionpublic abstract FileSystem getClient() throws java.io.IOException
FileSystem client.FileSystem clientjava.io.IOExceptionpublic abstract FileSystem getClient(FileSystemContext context) throws java.io.IOException
context - the FileSystemContext to useFileSystem client, using a specific contextjava.io.IOExceptionprotected abstract LocalAlluxioMaster getLocalAlluxioMaster()
public ProxyProcess getProxyProcess()
public void waitForWorkersRegistered(int timeoutMs)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
java.io.IOException
timeoutMs - the timeout to waitjava.util.concurrent.TimeoutExceptionjava.lang.InterruptedExceptionjava.io.IOExceptionprotected void reset()
protected void resetClientPools()
throws java.io.IOException
java.io.IOExceptionprotected void setHostname()
protected void setAlluxioWorkDirectory(java.lang.String name)
name - the name of the test/clusterCopyright © 2020. All Rights Reserved.