public abstract class MasterProcess extends Object implements Process
MasterProcess
should implement.
This class serves as a common implementation for functions that both the AlluxioMasterProcess and
AlluxioJobMasterProcess use. Each master should have an RPC server, web server, and journaling
system which can serve client requests.Modifier and Type | Field and Description |
---|---|
protected GrpcServer |
mGrpcServer
The RPC server.
|
protected JournalSystem |
mJournalSystem
The journal system for writing journal entries and restoring master state.
|
protected WebServer |
mWebServer
The web ui server.
|
Constructor and Description |
---|
MasterProcess(JournalSystem journalSystem,
NetworkAddressUtils.ServiceType rpcService,
NetworkAddressUtils.ServiceType webService)
Prepares a
MasterProcess journal, rpc and web server using the given sockets. |
Modifier and Type | Method and Description |
---|---|
abstract <T extends Master> |
getMaster(Class<T> clazz)
Gets the registered class from the master registry.
|
abstract InetSocketAddress |
getRpcAddress() |
long |
getStartTimeMs() |
long |
getUptimeMs() |
abstract InetSocketAddress |
getWebAddress() |
boolean |
isServing() |
protected void |
startRejectingServers() |
protected void |
startServing() |
protected void |
stopRejectingRpcServer() |
protected void |
stopRejectingServers() |
protected void |
stopRejectingWebServer() |
boolean |
waitForReady(int timeoutMs)
Waits until the process is ready to serve requests.
|
protected final JournalSystem mJournalSystem
protected GrpcServer mGrpcServer
protected WebServer mWebServer
public MasterProcess(JournalSystem journalSystem, NetworkAddressUtils.ServiceType rpcService, NetworkAddressUtils.ServiceType webService)
MasterProcess
journal, rpc and web server using the given sockets.journalSystem
- the journaling systemrpcService
- the rpc service typewebService
- the web service typepublic abstract InetSocketAddress getRpcAddress()
public abstract <T extends Master> T getMaster(Class<T> clazz)
T
- the type of the master to getclazz
- the class of the master to getpublic long getStartTimeMs()
protected void startServing()
public long getUptimeMs()
public abstract InetSocketAddress getWebAddress()
public boolean isServing()
public boolean waitForReady(int timeoutMs)
Process
waitForReady
in interface Process
timeoutMs
- how long to wait in millisecondsprotected void startRejectingServers()
protected void stopRejectingRpcServer()
protected void stopRejectingWebServer()
protected void stopRejectingServers()
Copyright © 2023. All Rights Reserved.