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
Modifier and TypeFieldDescriptionprivate org.apache.hadoop.conf.Configuration
private final String
private ReplicationPeerConfig
private final List<ReplicationPeerConfigListener>
private ReplicationPeer.PeerState
-
Constructor Summary
ConstructorDescriptionReplicationPeerImpl
(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.Configuration
Get the configuration object required to communicate with this peergetId()
Get the identifier of this peerGet replicable namespace set of this peerlong
Get 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 peervoid
onConfigurationChange
(org.apache.hadoop.conf.Configuration conf) This method would be called by theConfigurationManager
object when theConfiguration
object is reloaded from disk.void
Register a peer config listener to catch the peer config change event.void
setPeerConfig
(ReplicationPeerConfig peerConfig) void
setPeerState
(boolean enabled) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
getId
in interfaceReplicationPeer
- Returns:
- string representation of the id (short)
-
getPeerState
Description copied from interface:ReplicationPeer
Returns the state of the peer by reading local cache.- Specified by:
getPeerState
in interfaceReplicationPeer
- Returns:
- the enabled state
-
getPeerConfig
Get the peer config object- Specified by:
getPeerConfig
in interfaceReplicationPeer
- Returns:
- the ReplicationPeerConfig for this peer
-
getConfiguration
Get the configuration object required to communicate with this peer- Specified by:
getConfiguration
in interfaceReplicationPeer
- Returns:
- configuration object
-
getTableCFs
Get replicable (table, cf-list) map of this peer- Specified by:
getTableCFs
in interfaceReplicationPeer
- Returns:
- the replicable (table, cf-list) map
-
getNamespaces
Get replicable namespace set of this peer- Specified by:
getNamespaces
in interfaceReplicationPeer
- Returns:
- the replicable namespaces set
-
getPeerBandwidth
Description copied from interface:ReplicationPeer
Get the per node bandwidth upper limit for this peer- Specified by:
getPeerBandwidth
in interfaceReplicationPeer
- Returns:
- the bandwidth upper limit
-
registerPeerConfigListener
Description copied from interface:ReplicationPeer
Register a peer config listener to catch the peer config change event.- Specified by:
registerPeerConfigListener
in interfaceReplicationPeer
- Parameters:
listener
- listener to catch the peer config change event.
-
onConfigurationChange
Description copied from interface:ConfigurationObserver
This method would be called by theConfigurationManager
object when theConfiguration
object is reloaded from disk.- Specified by:
onConfigurationChange
in interfaceConfigurationObserver
-