@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, mHome, mHostname, mMasterConf, mUfsCluster, mUserBlockSize, mWorker, mWorkerCapacityBytes, mWorkerConf, mWorkerThread| Constructor and Description |
|---|
LocalAlluxioCluster(long workerCapacityBytes,
int userBlockSize) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAlluxioHome() |
FileSystem |
getClient()
Returns a
FileSystem client. |
LocalAlluxioMaster |
getMaster()
Gets the master which should be listening for RPC and Web requests.
|
String |
getMasterHostname() |
int |
getMasterPort() |
String |
getMasterUri() |
AlluxioWorker |
getWorker() |
WorkerNetAddress |
getWorkerAddress() |
Configuration |
getWorkerConf() |
protected void |
resetContext()
Resets contexts.
|
protected void |
startMaster(Configuration testConf)
Configures and starts a master.
|
protected void |
startWorker(Configuration conf)
Configures and starts a worker.
|
void |
stop()
Stops both the alluxio and underfs service threads.
|
void |
stopTFS()
Stops the alluxio filesystem's service thread only.
|
void |
stopWorker()
Cleans up the worker state from the master and stops the worker.
|
getMasterConf, newTestConf, runWorker, setAlluxioHome, setHostname, setupTest, start, start, stopUFSpublic LocalAlluxioCluster(long workerCapacityBytes,
int userBlockSize)
workerCapacityBytes - the capacity of the worker in bytesuserBlockSize - the block size for a userpublic FileSystem getClient() throws IOException
AbstractLocalAlluxioClusterFileSystem client.getClient in class AbstractLocalAlluxioClusterFileSystem clientIOException - when the operation failspublic LocalAlluxioMaster getMaster()
AbstractLocalAlluxioClustergetMaster in class AbstractLocalAlluxioClusterpublic String getMasterHostname()
public String getMasterUri()
public int getMasterPort()
public String getAlluxioHome()
public AlluxioWorker getWorker()
public Configuration getWorkerConf()
public WorkerNetAddress getWorkerAddress()
protected void startMaster(Configuration testConf) throws IOException
AbstractLocalAlluxioClusterstartMaster in class AbstractLocalAlluxioClustertestConf - configuration of this testIOException - when the operation failsprotected void startWorker(Configuration conf) throws IOException, ConnectionFailedException
AbstractLocalAlluxioClusterstartWorker in class AbstractLocalAlluxioClusterconf - configuration of this testIOException - if an I/O error occursConnectionFailedException - if network connection failedprotected void resetContext()
AbstractLocalAlluxioClusterresetContext in class AbstractLocalAlluxioClusterpublic void stopTFS()
throws Exception
AbstractLocalAlluxioClusterstopTFS in class AbstractLocalAlluxioClusterException - when the operation failspublic void stopWorker()
throws Exception
Exception - when the operation failspublic void stop()
throws Exception
AbstractLocalAlluxioClusterstop in class AbstractLocalAlluxioClusterException - when the operation failsCopyright © 2016. All Rights Reserved.