Package alluxio.master.selectionpolicy
Class AbstractMasterSelectionPolicy
- java.lang.Object
-
- alluxio.master.selectionpolicy.AbstractMasterSelectionPolicy
-
- All Implemented Interfaces:
MasterSelectionPolicy
- Direct Known Subclasses:
SelectionPolicyAnyMaster
,SelectionPolicyAnyStandbyMaster
,SelectionPolicyPrimaryMaster
,SelectionPolicySpecifiedMaster
public abstract class AbstractMasterSelectionPolicy extends java.lang.Object implements MasterSelectionPolicy
Base class of master selection policy that determines which master node a client should connect to.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface alluxio.master.selectionpolicy.MasterSelectionPolicy
MasterSelectionPolicy.Factory, MasterSelectionPolicy.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected java.net.InetSocketAddress
mPrimaryMasterAddress
-
Constructor Summary
Constructors Constructor Description AbstractMasterSelectionPolicy()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.net.InetSocketAddress
getGrpcMasterAddress(MasterInquireClient masterInquireClient)
Gets the master address the client makes gRPC request to.java.net.InetSocketAddress
getPrimaryMasterAddressCached(MasterInquireClient masterInquireClient)
Get and cache the primary master address.void
resetPrimaryMasterAddressCache()
Resets the cached primary master address.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface alluxio.master.selectionpolicy.MasterSelectionPolicy
getType
-
-
-
-
Method Detail
-
getPrimaryMasterAddressCached
public java.net.InetSocketAddress getPrimaryMasterAddressCached(MasterInquireClient masterInquireClient) throws UnavailableException
Description copied from interface:MasterSelectionPolicy
Get and cache the primary master address.- Specified by:
getPrimaryMasterAddressCached
in interfaceMasterSelectionPolicy
- Parameters:
masterInquireClient
- master inquire client- Returns:
- the remote address of primary master gRPC server
- Throws:
UnavailableException
- if address cannot be determined
-
getGrpcMasterAddress
public abstract java.net.InetSocketAddress getGrpcMasterAddress(MasterInquireClient masterInquireClient) throws UnavailableException
Description copied from interface:MasterSelectionPolicy
Gets the master address the client makes gRPC request to.- Specified by:
getGrpcMasterAddress
in interfaceMasterSelectionPolicy
- Parameters:
masterInquireClient
- master inquire client- Returns:
- the remote address of master gRPC server
- Throws:
UnavailableException
- if address cannot be determined
-
resetPrimaryMasterAddressCache
public void resetPrimaryMasterAddressCache()
Description copied from interface:MasterSelectionPolicy
Resets the cached primary master address.- Specified by:
resetPrimaryMasterAddressCache
in interfaceMasterSelectionPolicy
-
-