Package alluxio.master
Class LocalAlluxioMaster
- java.lang.Object
-
- alluxio.master.LocalAlluxioMaster
-
@NotThreadSafe public final class LocalAlluxioMaster extends java.lang.ObjectConstructs an isolated master. Primary users of this class are theLocalAlluxioClusterandMultiMasterLocalAlluxioCluster. Isolated is defined as having its own root directory, and port.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearClients()Clears all the clients.static LocalAlluxioMastercreate(boolean includeSecondary)Creates a new local Alluxio master with an isolated work directory and port.static LocalAlluxioMastercreate(java.lang.String workDirectory, boolean includeSecondary)Creates a new local Alluxio master with a isolated port.java.net.InetSocketAddressgetAddress()alluxio.client.file.FileSystemgetClient()alluxio.client.file.FileSystemgetClient(alluxio.client.file.FileSystemContext context)java.lang.StringgetJournalFolder()alluxio.master.AlluxioMasterProcessgetMasterProcess()intgetRpcLocalPort()Gets the actual port that the RPC service is listening on.java.lang.StringgetUri()booleanisServing()voidstart()Starts the master.voidstop()Stops the master processes and cleans up client connections.
-
-
-
Method Detail
-
create
public static LocalAlluxioMaster create(boolean includeSecondary) throws java.io.IOException
Creates a new local Alluxio master with an isolated work directory and port.- Parameters:
includeSecondary- whether to start a secondary master alongside the regular master- Returns:
- an instance of Alluxio master
- Throws:
java.io.IOException
-
create
public static LocalAlluxioMaster create(java.lang.String workDirectory, boolean includeSecondary) throws java.io.IOException
Creates a new local Alluxio master with a isolated port.- Parameters:
workDirectory- Alluxio work directory, this method will create it if it doesn't exist yetincludeSecondary- whether to start a secondary master alongside the regular master- Returns:
- the created Alluxio master
- Throws:
java.io.IOException
-
start
public void start()
Starts the master.
-
isServing
public boolean isServing()
- Returns:
- true if the master is serving, false otherwise
-
stop
public void stop() throws java.lang.ExceptionStops the master processes and cleans up client connections.- Throws:
java.lang.Exception
-
clearClients
public void clearClients() throws java.io.IOExceptionClears all the clients.- Throws:
java.io.IOException
-
getAddress
public java.net.InetSocketAddress getAddress()
- Returns:
- the externally resolvable address of the master
-
getMasterProcess
public alluxio.master.AlluxioMasterProcess getMasterProcess()
- Returns:
- the internal
MasterProcess
-
getRpcLocalPort
public int getRpcLocalPort()
Gets the actual port that the RPC service is listening on.- Returns:
- the RPC local port
-
getUri
public java.lang.String getUri()
- Returns:
- the URI of the master
-
getClient
public alluxio.client.file.FileSystem getClient() throws java.io.IOException- Returns:
- the client from the pool
- Throws:
java.io.IOException
-
getClient
public alluxio.client.file.FileSystem getClient(alluxio.client.file.FileSystemContext context) throws java.io.IOException- Parameters:
context- the FileSystemContext to use- Returns:
- the client from the pool, using a specific context
- Throws:
java.io.IOException
-
getJournalFolder
public java.lang.String getJournalFolder()
- Returns:
- the folder of the journal
-
-