Class ReplicationPeerImpl
java.lang.Object
org.apache.hadoop.hbase.replication.ReplicationPeerImpl
- All Implemented Interfaces:
ConfigurationObserver
,ReplicationPeer
@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 static final int
private org.apache.hadoop.conf.Configuration
private final String
private ReplicationPeerConfig
private final List<ReplicationPeerConfigListener>
private ReplicationPeer.PeerState
private static final int
private int
-
Constructor Summary
ConstructorDescriptionReplicationPeerImpl
(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. -
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 peerprivate static SyncReplicationState
getNewSyncReplicationState
(int bits) long
Get the per node bandwidth upper limit for this peerGet the peer config objectReturns the state of the peer by reading local cache.Returns the sync replication state of the peer by reading local cache.private static SyncReplicationState
getSyncReplicationState
(int bits) 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
void
setPeerConfig
(ReplicationPeerConfig peerConfig) void
setPeerState
(boolean enabled) void
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
-
syncReplicationStateBits
-
SHIFT
- See Also:
-
AND_BITS
- See Also:
-
peerConfigListeners
-
-
Constructor Details
-
ReplicationPeerImpl
public 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.- Parameters:
conf
- configuration object to this peerid
- string representation of this peer's identifierpeerConfig
- configuration for the replication peer
-
-
Method Details
-
setPeerState
-
setPeerConfig
-
setNewSyncReplicationState
-
transitSyncReplicationState
-
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
-
getSyncReplicationState
-
getNewSyncReplicationState
-
getSyncReplicationStateAndNewState
-
getNewSyncReplicationState
-
getSyncReplicationState
Description copied from interface:ReplicationPeer
Returns the sync replication state of the peer by reading local cache.If the peer is not a synchronous replication peer, a
SyncReplicationState.NONE
will be returned.- Specified by:
getSyncReplicationState
in interfaceReplicationPeer
- Returns:
- the sync replication state
-
getPeerConfig
Description copied from interface:ReplicationPeer
Get the peer config object- Specified by:
getPeerConfig
in interfaceReplicationPeer
- Returns:
- the ReplicationPeerConfig for this peer
-
getConfiguration
Description copied from interface:ReplicationPeer
Get the configuration object required to communicate with this peer- Specified by:
getConfiguration
in interfaceReplicationPeer
- Returns:
- configuration object
-
getTableCFs
Description copied from interface:ReplicationPeer
Get replicable (table, cf-list) map of this peer- Specified by:
getTableCFs
in interfaceReplicationPeer
- Returns:
- the replicable (table, cf-list) map
-
getNamespaces
Description copied from interface:ReplicationPeer
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
-