@NotThreadSafe public final class MultiMasterLocalAlluxioCluster extends AbstractLocalAlluxioCluster
mHostname, mProxyProcess, mProxyThread, mWorkDirectory, mWorkers, mWorkerThreads| Constructor and Description |
|---|
MultiMasterLocalAlluxioCluster(int numMasters)
Runs a multi master local Alluxio cluster with a single worker.
|
MultiMasterLocalAlluxioCluster(int numMasters,
int numWorkers) |
| Modifier and Type | Method and Description |
|---|---|
FileSystem |
getClient()
Returns a
FileSystem client. |
FileSystem |
getClient(FileSystemContext context) |
int |
getLeaderIndex() |
LocalAlluxioMaster |
getLocalAlluxioMaster() |
java.util.List<java.net.InetSocketAddress> |
getMasterAddresses() |
java.lang.String |
getUri() |
void |
initConfiguration(java.lang.String name)
Creates a default
ServerConfiguration for testing. |
void |
restartZk()
Restarts the cluster's Zookeeper service.
|
protected void |
startMasters()
Configures and starts the master(s).
|
void |
startWorkers()
Configures and starts the worker(s).
|
void |
stopFS()
Stops the alluxio filesystem's service thread only.
|
boolean |
stopLeader()
Iterates over the masters in the order of master creation, stops the leader master.
|
void |
stopMasters()
Stops the masters.
|
boolean |
stopStandby()
Iterates over the masters in the order of master creation, stops the first standby master.
|
void |
stopZk()
Stops the cluster's Zookeeper service.
|
void |
waitForNewMaster(int timeoutMs)
Waits for a new master to start until a timeout occurs.
|
formatAndRestartMasters, getProxyProcess, isStartedWorkers, reset, resetClientPools, restartMasters, setAlluxioWorkDirectory, setHostname, setupTest, start, startProxy, stop, stopProxy, stopWorkers, waitForWorkersRegisteredpublic MultiMasterLocalAlluxioCluster(int numMasters)
numMasters - the number masters to runpublic MultiMasterLocalAlluxioCluster(int numMasters,
int numWorkers)
numMasters - the number of masters to runnumWorkers - the number of workers to runpublic void initConfiguration(java.lang.String name)
throws java.io.IOException
AbstractLocalAlluxioClusterServerConfiguration for testing.initConfiguration in class AbstractLocalAlluxioClustername - the name of the test/clusterjava.io.IOExceptionpublic FileSystem getClient() throws java.io.IOException
AbstractLocalAlluxioClusterFileSystem client.getClient in class AbstractLocalAlluxioClusterFileSystem clientjava.io.IOExceptionpublic FileSystem getClient(FileSystemContext context) throws java.io.IOException
getClient in class AbstractLocalAlluxioClustercontext - the FileSystemContext to useFileSystem client, using a specific contextjava.io.IOExceptionpublic java.lang.String getUri()
public LocalAlluxioMaster getLocalAlluxioMaster()
getLocalAlluxioMaster in class AbstractLocalAlluxioClusterpublic int getLeaderIndex()
mMasters, or -1 if there is no leader temporarilypublic java.util.List<java.net.InetSocketAddress> getMasterAddresses()
public boolean stopStandby()
public boolean stopLeader()
public void waitForNewMaster(int timeoutMs)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException
timeoutMs - the number of milliseconds to wait before giving up and throwing an exceptionjava.util.concurrent.TimeoutExceptionjava.lang.InterruptedExceptionpublic void stopZk()
throws java.lang.Exception
java.lang.Exceptionpublic void restartZk()
throws java.lang.Exception
stopZk().java.lang.Exceptionprotected void startMasters()
throws java.io.IOException
AbstractLocalAlluxioClusterstartMasters in class AbstractLocalAlluxioClusterjava.io.IOExceptionpublic void startWorkers()
throws java.lang.Exception
AbstractLocalAlluxioClusterstartWorkers in class AbstractLocalAlluxioClusterjava.lang.Exceptionpublic void stopFS()
throws java.lang.Exception
AbstractLocalAlluxioClusterstopFS in class AbstractLocalAlluxioClusterjava.lang.Exceptionpublic void stopMasters()
throws java.lang.Exception
AbstractLocalAlluxioClusterstopMasters in class AbstractLocalAlluxioClusterjava.lang.ExceptionCopyright © 2022. All Rights Reserved.