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
FieldsModifier and TypeFieldDescriptionprivate static final intprivate org.apache.hadoop.conf.Configurationprivate final Stringprivate ReplicationPeerConfigprivate final List<ReplicationPeerConfigListener>private ReplicationPeer.PeerStateprivate static final intprivate int -
Constructor Summary
ConstructorsConstructorDescriptionReplicationPeerImpl(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.ConfigurationGet the configuration object required to communicate with this peergetId()Get the identifier of this peerGet replicable namespace set of this peerprivate static SyncReplicationStategetNewSyncReplicationState(int bits) longGet 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 SyncReplicationStategetSyncReplicationState(int bits) 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.voidvoidsetPeerConfig(ReplicationPeerConfig peerConfig) voidsetPeerState(boolean enabled) voidMethods 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
-
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:
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
-
getSyncReplicationState
-
getNewSyncReplicationState
-
getSyncReplicationStateAndNewState
-
getNewSyncReplicationState
-
getSyncReplicationState
Description copied from interface:ReplicationPeerReturns the sync replication state of the peer by reading local cache.If the peer is not a synchronous replication peer, a
SyncReplicationState.NONEwill be returned.- Specified by:
getSyncReplicationStatein interfaceReplicationPeer- Returns:
- the sync replication state
-
getPeerConfig
Description copied from interface:ReplicationPeerGet the peer config object- Specified by:
getPeerConfigin interfaceReplicationPeer- Returns:
- the ReplicationPeerConfig for this peer
-
getConfiguration
Description copied from interface:ReplicationPeerGet the configuration object required to communicate with this peer- Specified by:
getConfigurationin interfaceReplicationPeer- Returns:
- configuration object
-
getTableCFs
Description copied from interface:ReplicationPeerGet replicable (table, cf-list) map of this peer- Specified by:
getTableCFsin interfaceReplicationPeer- Returns:
- the replicable (table, cf-list) map
-
getNamespaces
Description copied from interface:ReplicationPeerGet 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
-