@NotThreadSafe public final class LocalAlluxioCluster extends AbstractLocalAlluxioCluster
// Create a cluster instance localAlluxioCluster = new LocalAlluxioCluster(WORKER_CAPACITY_BYTES, BLOCK_SIZE_BYTES); // If you have special conf parameter to set for integration tests: AlluxioConfiguration testConf = localAlluxioCluster.newTestConf(); testConf.set(Constants.USER_FILE_BUFFER_BYTES, String.valueOf(BUFFER_BYTES)); // After setting up the test conf, start this local cluster: localAlluxioCluster.start(testConf);
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_TEST_NAME |
mHostname, mProxyProcess, mProxyThread, mWorkDirectory, mWorkers, mWorkerThreads
Constructor and Description |
---|
LocalAlluxioCluster()
Runs a test Alluxio cluster with a single Alluxio worker.
|
LocalAlluxioCluster(int numWorkers) |
Modifier and Type | Method and Description |
---|---|
String |
getAlluxioHome() |
FileSystem |
getClient()
Returns a
FileSystem client. |
FileSystem |
getClient(FileSystemContext context) |
String |
getHostname() |
LocalAlluxioMaster |
getLocalAlluxioMaster() |
int |
getMasterRpcPort() |
String |
getMasterURI() |
WorkerNetAddress |
getWorkerAddress() |
WorkerProcess |
getWorkerProcess() |
void |
initConfiguration(String name)
Creates a default
ServerConfiguration for testing. |
void |
startMasters()
Configures and starts the master(s).
|
void |
stop()
Stops both the alluxio and underfs service threads.
|
void |
stopMasters()
Stops the masters.
|
formatAndRestartMasters, getProxyProcess, isStartedWorkers, reset, resetClientPools, restartMasters, setAlluxioWorkDirectory, setHostname, setupTest, start, startWorkers, stopFS, stopProxy, stopWorkers, waitForWorkersRegistered
public static final String DEFAULT_TEST_NAME
public LocalAlluxioCluster()
public LocalAlluxioCluster(int numWorkers)
numWorkers
- the number of workers to runpublic FileSystem getClient() throws IOException
AbstractLocalAlluxioCluster
FileSystem
client.getClient
in class AbstractLocalAlluxioCluster
FileSystem
clientIOException
public FileSystem getClient(FileSystemContext context) throws IOException
getClient
in class AbstractLocalAlluxioCluster
context
- the FileSystemContext to useFileSystem
client, using a specific contextIOException
public LocalAlluxioMaster getLocalAlluxioMaster()
getLocalAlluxioMaster
in class AbstractLocalAlluxioCluster
public String getHostname()
public String getMasterURI()
public int getMasterRpcPort()
public String getAlluxioHome()
public WorkerProcess getWorkerProcess()
public WorkerNetAddress getWorkerAddress()
public void initConfiguration(String name) throws IOException
AbstractLocalAlluxioCluster
ServerConfiguration
for testing.initConfiguration
in class AbstractLocalAlluxioCluster
name
- the name of the test/clusterIOException
public void startMasters() throws Exception
AbstractLocalAlluxioCluster
startMasters
in class AbstractLocalAlluxioCluster
Exception
public void stop() throws Exception
AbstractLocalAlluxioCluster
stop
in class AbstractLocalAlluxioCluster
Exception
public void stopMasters() throws Exception
AbstractLocalAlluxioCluster
stopMasters
in class AbstractLocalAlluxioCluster
Exception
Copyright © 2023. All Rights Reserved.