Class ReplicationPeerImpl
java.lang.Object
org.apache.hadoop.hbase.replication.ReplicationPeerImpl
- All Implemented Interfaces:
ConfigurationObserver,ReplicationPeer
- Direct Known Subclasses:
CatalogReplicationSourcePeer
@Private
public class ReplicationPeerImpl
extends Object
implements ReplicationPeer, ConfigurationObserver
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.replication.ReplicationPeer
ReplicationPeer.PeerState -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.conf.Configurationprivate final Stringprivate ReplicationPeerConfigprivate final List<ReplicationPeerConfigListener>private ReplicationPeer.PeerState -
Constructor Summary
ConstructorsConstructorDescriptionReplicationPeerImpl(org.apache.hadoop.conf.Configuration conf, String id, boolean peerState, ReplicationPeerConfig peerConfig) Constructor that takes all the objects required to communicate with the specified peer, except for the region server addresses. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.conf.ConfigurationGet the configuration object required to communicate with this peergetId()Get the identifier of this peerGet replicable namespace set of this peerlongGet the per node bandwidth upper limit for this peerGet the peer config objectReturns the state of the peer by reading local cache.Get replicable (table, cf-list) map of this peervoidonConfigurationChange(org.apache.hadoop.conf.Configuration conf) This method would be called by theConfigurationManagerobject when theConfigurationobject is reloaded from disk.voidRegister a peer config listener to catch the peer config change event.voidsetPeerConfig(ReplicationPeerConfig peerConfig) voidsetPeerState(boolean enabled) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.replication.ReplicationPeer
isPeerEnabled, trackPeerConfigChanges
-
Field Details
-
conf
-
id
-
peerConfig
-
peerState
-
peerConfigListeners
-
-
Constructor Details
-
ReplicationPeerImpl
public ReplicationPeerImpl(org.apache.hadoop.conf.Configuration conf, String id, boolean peerState, ReplicationPeerConfig peerConfig) Constructor that takes all the objects required to communicate with the specified peer, except for the region server addresses.- Parameters:
conf- configuration object to this peerid- string representation of this peer's identifierpeerConfig- configuration for the replication peer
-
-
Method Details
-
setPeerState
-
setPeerConfig
-
getId
Get the identifier of this peer- Specified by:
getIdin interfaceReplicationPeer- Returns:
- string representation of the id (short)
-
getPeerState
Description copied from interface:ReplicationPeerReturns the state of the peer by reading local cache.- Specified by:
getPeerStatein interfaceReplicationPeer- Returns:
- the enabled state
-
getPeerConfig
Get the peer config object- Specified by:
getPeerConfigin interfaceReplicationPeer- Returns:
- the ReplicationPeerConfig for this peer
-
getConfiguration
Get the configuration object required to communicate with this peer- Specified by:
getConfigurationin interfaceReplicationPeer- Returns:
- configuration object
-
getTableCFs
Get replicable (table, cf-list) map of this peer- Specified by:
getTableCFsin interfaceReplicationPeer- Returns:
- the replicable (table, cf-list) map
-
getNamespaces
Get replicable namespace set of this peer- Specified by:
getNamespacesin interfaceReplicationPeer- Returns:
- the replicable namespaces set
-
getPeerBandwidth
Description copied from interface:ReplicationPeerGet the per node bandwidth upper limit for this peer- Specified by:
getPeerBandwidthin interfaceReplicationPeer- Returns:
- the bandwidth upper limit
-
registerPeerConfigListener
Description copied from interface:ReplicationPeerRegister a peer config listener to catch the peer config change event.- Specified by:
registerPeerConfigListenerin interfaceReplicationPeer- Parameters:
listener- listener to catch the peer config change event.
-
onConfigurationChange
Description copied from interface:ConfigurationObserverThis method would be called by theConfigurationManagerobject when theConfigurationobject is reloaded from disk.- Specified by:
onConfigurationChangein interfaceConfigurationObserver
-