Class ZKReplicationPeerStorage
java.lang.Object
org.apache.hadoop.hbase.replication.ZKReplicationStorageBase
org.apache.hadoop.hbase.replication.ZKReplicationPeerStorage
- All Implemented Interfaces:
ReplicationPeerStorage
@Private
public class ZKReplicationPeerStorage
extends ZKReplicationStorageBase
implements ReplicationPeerStorage
ZK based replication peer storage.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte[]static final byte[]static final Stringstatic final Stringstatic final Stringstatic final Stringprivate final StringThe name of the znode that contains the replication status of a remote slave (i.e.private final StringThe name of the znode that contains a list of all remote slave (i.e.Fields inherited from class org.apache.hadoop.hbase.replication.ZKReplicationStorageBase
conf, REPLICATION_ZNODE, REPLICATION_ZNODE_DEFAULT, replicationZNode, zookeeper -
Constructor Summary
ConstructorsConstructorDescriptionZKReplicationPeerStorage(ZKWatcher zookeeper, org.apache.hadoop.conf.Configuration conf) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPeer(String peerId, ReplicationPeerConfig peerConfig, boolean enabled) Add a replication peer.getPeerConfig(String peerId) Get the peer config of a replication peer.getPeerNode(String peerId) getPeerStateNode(String peerId) booleanisPeerEnabled(String peerId) Test whether a replication peer is enabled.Return the peer ids of all replication peers.voidremovePeer(String peerId) Remove a replication peer.voidsetPeerState(String peerId, boolean enabled) Set the state of peer,truetoENABLED, otherwise toDISABLED.voidupdatePeerConfig(String peerId, ReplicationPeerConfig peerConfig) Update the config a replication peer.Methods inherited from class org.apache.hadoop.hbase.replication.ZKReplicationStorageBase
toByteArray
-
Field Details
-
PEERS_ZNODE
- See Also:
-
PEERS_ZNODE_DEFAULT
- See Also:
-
PEERS_STATE_ZNODE
- See Also:
-
PEERS_STATE_ZNODE_DEFAULT
- See Also:
-
ENABLED_ZNODE_BYTES
-
DISABLED_ZNODE_BYTES
-
peerStateNodeName
The name of the znode that contains the replication status of a remote slave (i.e. peer) cluster. -
peersZNode
The name of the znode that contains a list of all remote slave (i.e. peer) clusters.
-
-
Constructor Details
-
ZKReplicationPeerStorage
-
-
Method Details
-
getPeerStateNode
-
getPeerNode
-
addPeer
public void addPeer(String peerId, ReplicationPeerConfig peerConfig, boolean enabled) throws ReplicationException Description copied from interface:ReplicationPeerStorageAdd a replication peer.- Specified by:
addPeerin interfaceReplicationPeerStorage- Throws:
ReplicationException- if there are errors accessing the storage service.
-
removePeer
Description copied from interface:ReplicationPeerStorageRemove a replication peer.- Specified by:
removePeerin interfaceReplicationPeerStorage- Throws:
ReplicationException- if there are errors accessing the storage service.
-
setPeerState
Description copied from interface:ReplicationPeerStorageSet the state of peer,truetoENABLED, otherwise toDISABLED.- Specified by:
setPeerStatein interfaceReplicationPeerStorage- Throws:
ReplicationException- if there are errors accessing the storage service.
-
updatePeerConfig
public void updatePeerConfig(String peerId, ReplicationPeerConfig peerConfig) throws ReplicationException Description copied from interface:ReplicationPeerStorageUpdate the config a replication peer.- Specified by:
updatePeerConfigin interfaceReplicationPeerStorage- Throws:
ReplicationException- if there are errors accessing the storage service.
-
listPeerIds
Description copied from interface:ReplicationPeerStorageReturn the peer ids of all replication peers.- Specified by:
listPeerIdsin interfaceReplicationPeerStorage- Throws:
ReplicationException- if there are errors accessing the storage service.
-
isPeerEnabled
Description copied from interface:ReplicationPeerStorageTest whether a replication peer is enabled.- Specified by:
isPeerEnabledin interfaceReplicationPeerStorage- Throws:
ReplicationException- if there are errors accessing the storage service.
-
getPeerConfig
Description copied from interface:ReplicationPeerStorageGet the peer config of a replication peer.- Specified by:
getPeerConfigin interfaceReplicationPeerStorage- Throws:
ReplicationException- if there are errors accessing the storage service.
-