@NotThreadSafe public final class DefaultMetaMaster extends CoreMaster implements MetaMaster
Modifier and Type | Class and Description |
---|---|
static class |
DefaultMetaMaster.State
Journaled state for
MetaMaster . |
Modifier and Type | Field and Description |
---|---|
static String |
INVALID_CLUSTER_ID
Value to be used for the cluster ID when not assigned.
|
mBackupManager, mJournalSystem, mPort, mPrimarySelector, mSafeModeManager, mStartTimeMs
mJournal, mMasterContext
Modifier and Type | Method and Description |
---|---|
BackupStatus |
backup(BackupPRequest request,
StateLockOptions stateLockOptions)
Takes a backup.
|
String |
checkpoint()
Creates a checkpoint in the primary master journal system.
|
BackupStatus |
getBackupStatus(BackupStatusPRequest statusPRequest)
Used to query the status of a backup.
|
CheckpointName |
getCheckpointName() |
String |
getClusterID() |
ConfigCheckReport |
getConfigCheckReport() |
ConfigHash |
getConfigHash() |
Configuration |
getConfiguration(GetConfigurationPOptions options) |
Set<Class<? extends Server>> |
getDependencies() |
CloseableIterator<Journal.JournalEntry> |
getJournalEntryIterator() |
Optional<JournalSpaceMonitor> |
getJournalSpaceMonitor() |
MasterInfo[] |
getLostMasterInfos() |
Address |
getMasterAddress() |
List<Address> |
getMasterAddresses() |
long |
getMasterId(Address address)
Returns a master id for the given master, creating one if the master is new.
|
String |
getName() |
boolean |
getNewerVersionAvailable() |
InetSocketAddress |
getRpcAddress() |
Map<ServiceType,GrpcService> |
getServices() |
MasterInfo[] |
getStandbyMasterInfos() |
Map<ServiceType,GrpcService> |
getStandbyServices() |
long |
getStartTimeMs() |
long |
getUptimeMs() |
int |
getWebPort() |
List<Address> |
getWorkerAddresses() |
boolean |
isInSafeMode() |
List<ProxyStatus> |
listProxyStatus()
Lists information of all known Proxy instances.
|
MetaCommand |
masterHeartbeat(long masterId,
MasterHeartbeatPOptions options)
A standby master periodically heartbeats with the leader master.
|
void |
masterRegister(long masterId,
RegisterMasterPOptions options)
A standby master registers with the leader master.
|
boolean |
processJournalEntry(Journal.JournalEntry entry)
Attempts to apply a journal entry.
|
void |
proxyHeartbeat(ProxyHeartbeatPRequest request)
A Proxy periodically heartbeats with the primary master.
|
void |
removePathConfiguration(String path)
Removes all properties for a path.
|
void |
removePathConfiguration(String path,
Set<String> keys)
Removes properties for a path.
|
void |
resetState()
Resets the object's journaled state.
|
void |
setNewerVersionAvailable(boolean available)
Sets whether newer version Alluxio is available.
|
void |
setPathConfiguration(String path,
Map<PropertyKey,String> properties)
Sets properties for a path.
|
void |
start(Boolean isPrimary)
Starts the Alluxio server.
|
void |
stop()
Stops the Alluxio server.
|
BackupStatus |
takeEmergencyBackup()
Overrides current backup role and forces the master to take a local backup.
|
Map<String,Boolean> |
updateConfiguration(Map<String,String> propertiesMap) |
close, createJournalContext, getExecutorService, getMasterContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createJournalContext, getMasterContext
applyAndJournal, restoreFromCheckpoint, writeToCheckpoint
restoreFromCheckpoint, writeToCheckpoint
public static final String INVALID_CLUSTER_ID
public Map<ServiceType,GrpcService> getServices()
getServices
in interface Server<Boolean>
public Map<ServiceType,GrpcService> getStandbyServices()
getStandbyServices
in interface Master
public String getName()
public Set<Class<? extends Server>> getDependencies()
getDependencies
in interface Server<Boolean>
getDependencies
in class AbstractMaster
public void start(Boolean isPrimary) throws IOException
Server
start
in interface Server<Boolean>
start
in class AbstractMaster
isPrimary
- the start optionsIOException
public void stop() throws IOException
Server
#start(T)
should be
cleaned up and shutdown.stop
in interface Server<Boolean>
stop
in class AbstractMaster
IOException
public BackupStatus takeEmergencyBackup() throws AlluxioException
BackupStatus
AlluxioException
- if it encounters issues triggering the backuppublic BackupStatus backup(BackupPRequest request, StateLockOptions stateLockOptions) throws AlluxioException
BackupOps
BackupOps.getBackupStatus(alluxio.grpc.BackupStatusPRequest)
should be called
for querying the status of the on-going backup.
Note: When leader has no standby in an HA cluster, it will reject backup. This could be
allowed by passing "AllowLeader" option in the request.backup
in interface BackupOps
request
- the backup requeststateLockOptions
- the state lock options during the backupAlluxioException
- if backup failspublic BackupStatus getBackupStatus(BackupStatusPRequest statusPRequest) throws AlluxioException
BackupOps
getBackupStatus
in interface BackupOps
statusPRequest
- status requestAlluxioException
- if request failspublic String checkpoint() throws IOException
MetaMaster
checkpoint
in interface MetaMaster
IOException
public ConfigCheckReport getConfigCheckReport()
getConfigCheckReport
in interface MetaMaster
public Configuration getConfiguration(GetConfigurationPOptions options)
getConfiguration
in interface MetaMaster
options
- method optionspublic ConfigHash getConfigHash()
getConfigHash
in interface MetaMaster
public Optional<JournalSpaceMonitor> getJournalSpaceMonitor()
getJournalSpaceMonitor
in interface MetaMaster
public void setPathConfiguration(String path, Map<PropertyKey,String> properties) throws UnavailableException
MetaMaster
setPathConfiguration
in interface MetaMaster
path
- the pathproperties
- the properties for pathUnavailableException
public void removePathConfiguration(String path, Set<String> keys) throws UnavailableException
MetaMaster
removePathConfiguration
in interface MetaMaster
path
- the pathkeys
- the property keysUnavailableException
public void removePathConfiguration(String path) throws UnavailableException
MetaMaster
removePathConfiguration
in interface MetaMaster
path
- the pathUnavailableException
public void setNewerVersionAvailable(boolean available)
MetaMaster
setNewerVersionAvailable
in interface MetaMaster
available
- new version is availablepublic boolean getNewerVersionAvailable()
getNewerVersionAvailable
in interface MetaMaster
public Address getMasterAddress()
getMasterAddress
in interface MetaMaster
public List<Address> getMasterAddresses()
getMasterAddresses
in interface MetaMaster
public List<Address> getWorkerAddresses()
getWorkerAddresses
in interface MetaMaster
public MasterInfo[] getStandbyMasterInfos()
getStandbyMasterInfos
in interface MetaMaster
MasterInfo
of standby masterspublic MasterInfo[] getLostMasterInfos()
getLostMasterInfos
in interface MetaMaster
MasterInfo
of lost masterspublic long getMasterId(Address address)
MetaMaster
getMasterId
in interface MetaMaster
address
- the master hostnamepublic InetSocketAddress getRpcAddress()
getRpcAddress
in interface MetaMaster
public long getStartTimeMs()
getStartTimeMs
in interface MetaMaster
public long getUptimeMs()
getUptimeMs
in interface MetaMaster
public int getWebPort()
getWebPort
in interface MetaMaster
public boolean isInSafeMode()
isInSafeMode
in interface MetaMaster
public MetaCommand masterHeartbeat(long masterId, MasterHeartbeatPOptions options)
MetaMaster
masterHeartbeat
in interface MetaMaster
masterId
- the master idoptions
- the options that contains optional master infopublic void masterRegister(long masterId, RegisterMasterPOptions options) throws NotFoundException
MetaMaster
masterRegister
in interface MetaMaster
masterId
- the master id of the standby master registeringoptions
- the options that contains master configurationNotFoundException
- if masterId cannot be foundpublic void proxyHeartbeat(ProxyHeartbeatPRequest request)
MetaMaster
proxyHeartbeat
in interface MetaMaster
request
- the heartbeat messagepublic CheckpointName getCheckpointName()
getCheckpointName
in interface Checkpointed
public String getClusterID()
getClusterID
in interface MetaMaster
public CloseableIterator<Journal.JournalEntry> getJournalEntryIterator()
getJournalEntryIterator
in interface JournalEntryIterable
CloseableIterator
that iterates all the journal entriespublic boolean processJournalEntry(Journal.JournalEntry entry)
Journaled
processJournalEntry
in interface Journaled
entry
- the entry to applypublic void resetState()
Journaled
resetState
in interface Journaled
public Map<String,Boolean> updateConfiguration(Map<String,String> propertiesMap)
updateConfiguration
in interface MetaMaster
propertiesMap
- properties to updatepublic List<ProxyStatus> listProxyStatus()
MetaMaster
listProxyStatus
in interface MetaMaster
Copyright © 2023. All Rights Reserved.