@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(String name)
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(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 Thread mProxyThread
protected List<WorkerProcess> mWorkers
protected String mWorkDirectory
protected String mHostname
public void start() throws Exception
Exception
protected abstract void startMasters() throws Exception
Exception
public void restartMasters() throws Exception
Exception
public void startWorkers() throws Exception
Exception
protected void setupTest() throws IOException
IOException
public void stop() throws Exception
Exception
public void stopFS() throws Exception
Exception
public void formatAndRestartMasters() throws Exception
Exception
protected abstract void stopMasters() throws Exception
Exception
public abstract void initConfiguration(String name) throws IOException
ServerConfiguration
for testing.name
- the name of the test/clusterIOException
public abstract FileSystem getClient() throws IOException
FileSystem
client.FileSystem
clientIOException
public abstract FileSystem getClient(FileSystemContext context) throws IOException
context
- the FileSystemContext to useFileSystem
client, using a specific contextIOException
protected abstract LocalAlluxioMaster getLocalAlluxioMaster()
public ProxyProcess getProxyProcess()
public void waitForWorkersRegistered(int timeoutMs) throws TimeoutException, InterruptedException, IOException
timeoutMs
- the timeout to waitTimeoutException
InterruptedException
IOException
protected void reset()
protected void resetClientPools() throws IOException
IOException
protected void setHostname()
protected void setAlluxioWorkDirectory(String name)
name
- the name of the test/clusterCopyright © 2023. All Rights Reserved.