@InterfaceAudience.Private public class ReplicationPeerImpl extends Object implements ReplicationPeer, ConfigurationObserver
ReplicationPeer.PeerState| Constructor and Description |
|---|
ReplicationPeerImpl(org.apache.hadoop.conf.Configuration conf,
String id,
ReplicationPeerConfig peerConfig,
boolean peerState,
SyncReplicationState syncReplicationState,
SyncReplicationState newSyncReplicationState)
Constructor that takes all the objects required to communicate with the specified peer, except
for the region server addresses.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.hadoop.conf.Configuration |
getConfiguration()
Get the configuration object required to communicate with this peer
|
String |
getId()
Get the identifier of this peer
|
Set<String> |
getNamespaces()
Get replicable namespace set of this peer
|
SyncReplicationState |
getNewSyncReplicationState() |
long |
getPeerBandwidth()
Get the per node bandwidth upper limit for this peer
|
ReplicationPeerConfig |
getPeerConfig()
Get the peer config object
|
ReplicationPeer.PeerState |
getPeerState()
Returns the state of the peer by reading local cache.
|
SyncReplicationState |
getSyncReplicationState()
Returns the sync replication state of the peer by reading local cache.
|
Pair<SyncReplicationState,SyncReplicationState> |
getSyncReplicationStateAndNewState() |
Map<TableName,List<String>> |
getTableCFs()
Get replicable (table, cf-list) map of this peer
|
void |
onConfigurationChange(org.apache.hadoop.conf.Configuration conf) |
void |
registerPeerConfigListener(ReplicationPeerConfigListener listener)
Register a peer config listener to catch the peer config change event.
|
void |
setNewSyncReplicationState(SyncReplicationState newState) |
void |
setPeerConfig(ReplicationPeerConfig peerConfig) |
void |
setPeerState(boolean enabled) |
void |
transitSyncReplicationState() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisPeerEnabled, trackPeerConfigChangespublic ReplicationPeerImpl(org.apache.hadoop.conf.Configuration conf,
String id,
ReplicationPeerConfig peerConfig,
boolean peerState,
SyncReplicationState syncReplicationState,
SyncReplicationState newSyncReplicationState)
conf - configuration object to this peerid - string representation of this peer's identifierpeerConfig - configuration for the replication peerpublic void setPeerState(boolean enabled)
public void setPeerConfig(ReplicationPeerConfig peerConfig)
public void setNewSyncReplicationState(SyncReplicationState newState)
public void transitSyncReplicationState()
public String getId()
getId in interface ReplicationPeerpublic ReplicationPeer.PeerState getPeerState()
ReplicationPeergetPeerState in interface ReplicationPeerpublic Pair<SyncReplicationState,SyncReplicationState> getSyncReplicationStateAndNewState()
public SyncReplicationState getNewSyncReplicationState()
public SyncReplicationState getSyncReplicationState()
ReplicationPeer
If the peer is not a synchronous replication peer, a SyncReplicationState.NONE will be
returned.
getSyncReplicationState in interface ReplicationPeerpublic ReplicationPeerConfig getPeerConfig()
ReplicationPeergetPeerConfig in interface ReplicationPeerpublic org.apache.hadoop.conf.Configuration getConfiguration()
ReplicationPeergetConfiguration in interface ReplicationPeerpublic Map<TableName,List<String>> getTableCFs()
ReplicationPeergetTableCFs in interface ReplicationPeerpublic Set<String> getNamespaces()
ReplicationPeergetNamespaces in interface ReplicationPeerpublic long getPeerBandwidth()
ReplicationPeergetPeerBandwidth in interface ReplicationPeerpublic void registerPeerConfigListener(ReplicationPeerConfigListener listener)
ReplicationPeerregisterPeerConfigListener in interface ReplicationPeerlistener - listener to catch the peer config change event.public void onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
onConfigurationChange in interface ConfigurationObserverCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.