@NotThreadSafe
public abstract class AbstractLocalAlluxioCluster
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
mHostname |
protected int |
mNumWorkers |
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.
|
protected void |
formatJournal() |
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
Configuration for testing. |
boolean |
isStartedWorkers() |
void |
killWorkerProcesses()
Kills all worker processes without forgetting them in the master,
so we can validate the master mechanism handling dead workers.
|
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).
|
void |
restartWorkers(java.util.Collection<WorkerNetAddress> addresses)
Restarts workers with the addresses provided, so that the workers can restart with
static addresses to simulate a worker restart in the cluster.
|
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).
|
protected void |
startProxy()
Configures and starts the proxy.
|
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.
|
protected void |
waitForMasterServing() |
void |
waitForWorkersRegistered(int timeoutMs)
Waits for all workers registered with master.
|
protected void |
waitForWorkersServing() |
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
protected int mNumWorkers
public void start()
throws java.lang.Exception
java.lang.Exceptionprotected abstract void startMasters()
throws java.lang.Exception
java.lang.Exceptionprotected void waitForWorkersServing()
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException
java.util.concurrent.TimeoutExceptionjava.lang.InterruptedExceptionprotected void waitForMasterServing()
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException
java.util.concurrent.TimeoutExceptionjava.lang.InterruptedExceptionpublic void restartMasters()
throws java.lang.Exception
java.lang.Exceptionprotected void startProxy()
throws java.lang.Exception
java.lang.Exceptionpublic void startWorkers()
throws java.lang.Exception
java.lang.Exceptionpublic void restartWorkers(java.util.Collection<WorkerNetAddress> addresses) throws java.lang.Exception
addresses - worker addresses to usejava.lang.Exceptionprotected void setupTest()
throws java.io.IOException
java.io.IOExceptionprotected void formatJournal()
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 void killWorkerProcesses()
throws java.lang.Exception
java.lang.Exceptionpublic boolean isStartedWorkers()
public abstract void initConfiguration(java.lang.String name)
throws java.io.IOException
Configuration 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()
protected void setHostname()
protected void setAlluxioWorkDirectory(java.lang.String name)
name - the name of the test/clusterCopyright © 2024. All Rights Reserved.