@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: Configuration 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);
LOG, mHostname, mUfsCluster, mWorkDirectory, mWorkers| 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. |
String |
getHostname() |
LocalAlluxioMaster |
getMaster()
Gets the master which should be listening for RPC and Web requests.
|
int |
getMasterRpcPort() |
String |
getMasterURI() |
AlluxioWorkerService |
getWorker() |
WorkerNetAddress |
getWorkerAddress() |
protected void |
startMaster()
Configures and starts a master.
|
protected void |
startWorkers()
Configures and starts the workers.
|
void |
stop()
Stops both the alluxio and underfs service threads.
|
void |
stopFS()
Stops the alluxio filesystem's service thread only.
|
initConfiguration, reset, runWorkers, setAlluxioWorkDirectory, setHostname, setupTest, start, stopUFSpublic LocalAlluxioCluster()
public LocalAlluxioCluster(int numWorkers)
numWorkers - the number of workers to runpublic FileSystem getClient() throws IOException
AbstractLocalAlluxioClusterFileSystem client.getClient in class AbstractLocalAlluxioClusterFileSystem clientIOException - when the operation failspublic LocalAlluxioMaster getMaster()
AbstractLocalAlluxioClustergetMaster in class AbstractLocalAlluxioClusterpublic String getHostname()
public String getMasterURI()
public int getMasterRpcPort()
public String getAlluxioHome()
public AlluxioWorkerService getWorker()
public WorkerNetAddress getWorkerAddress()
protected void startMaster()
throws IOException
AbstractLocalAlluxioClusterstartMaster in class AbstractLocalAlluxioClusterIOException - when the operation failsprotected void startWorkers()
throws IOException,
ConnectionFailedException
AbstractLocalAlluxioClusterstartWorkers in class AbstractLocalAlluxioClusterIOException - if an I/O error occursConnectionFailedException - if network connection failedpublic void stopFS()
throws Exception
AbstractLocalAlluxioClusterstopFS in class AbstractLocalAlluxioClusterException - when the operation failspublic void stop()
throws Exception
AbstractLocalAlluxioClusterstop in class AbstractLocalAlluxioClusterException - when the operation failsCopyright © 2016. All Rights Reserved.