public abstract class AbstractMasterSelectionPolicy extends Object implements MasterSelectionPolicy
MasterSelectionPolicy.Factory, MasterSelectionPolicy.Type
Modifier and Type | Field and Description |
---|---|
protected InetSocketAddress |
mPrimaryMasterAddress |
Constructor and Description |
---|
AbstractMasterSelectionPolicy() |
Modifier and Type | Method and Description |
---|---|
abstract InetSocketAddress |
getGrpcMasterAddress(MasterInquireClient masterInquireClient)
Gets the master address the client makes gRPC request to.
|
InetSocketAddress |
getPrimaryMasterAddressCached(MasterInquireClient masterInquireClient)
Get and cache the primary master address.
|
void |
resetPrimaryMasterAddressCache()
Resets the cached primary master address.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getType
@Nullable protected volatile InetSocketAddress mPrimaryMasterAddress
public InetSocketAddress getPrimaryMasterAddressCached(MasterInquireClient masterInquireClient) throws UnavailableException
MasterSelectionPolicy
getPrimaryMasterAddressCached
in interface MasterSelectionPolicy
masterInquireClient
- master inquire clientUnavailableException
- if address cannot be determinedpublic abstract InetSocketAddress getGrpcMasterAddress(MasterInquireClient masterInquireClient) throws UnavailableException
MasterSelectionPolicy
getGrpcMasterAddress
in interface MasterSelectionPolicy
masterInquireClient
- master inquire clientUnavailableException
- if address cannot be determinedpublic void resetPrimaryMasterAddressCache()
MasterSelectionPolicy
resetPrimaryMasterAddressCache
in interface MasterSelectionPolicy
Copyright © 2023. All Rights Reserved.