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
Modifier and TypeFieldDescriptionstatic final byte[]
static final byte[]
static final String
static final String
static final String
static final String
private final String
The name of the znode that contains the replication status of a remote slave (i.e.private final String
The 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
ConstructorDescriptionZKReplicationPeerStorage
(ZKWatcher zookeeper, org.apache.hadoop.conf.Configuration conf) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPeer
(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) boolean
isPeerEnabled
(String peerId) Test whether a replication peer is enabled.Return the peer ids of all replication peers.void
removePeer
(String peerId) Remove a replication peer.void
setPeerState
(String peerId, boolean enabled) Set the state of peer,true
toENABLED
, otherwise toDISABLED
.void
updatePeerConfig
(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:ReplicationPeerStorage
Add a replication peer.- Specified by:
addPeer
in interfaceReplicationPeerStorage
- Throws:
ReplicationException
- if there are errors accessing the storage service.
-
removePeer
Description copied from interface:ReplicationPeerStorage
Remove a replication peer.- Specified by:
removePeer
in interfaceReplicationPeerStorage
- Throws:
ReplicationException
- if there are errors accessing the storage service.
-
setPeerState
Description copied from interface:ReplicationPeerStorage
Set the state of peer,true
toENABLED
, otherwise toDISABLED
.- Specified by:
setPeerState
in 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:ReplicationPeerStorage
Update the config a replication peer.- Specified by:
updatePeerConfig
in interfaceReplicationPeerStorage
- Throws:
ReplicationException
- if there are errors accessing the storage service.
-
listPeerIds
Description copied from interface:ReplicationPeerStorage
Return the peer ids of all replication peers.- Specified by:
listPeerIds
in interfaceReplicationPeerStorage
- Throws:
ReplicationException
- if there are errors accessing the storage service.
-
isPeerEnabled
Description copied from interface:ReplicationPeerStorage
Test whether a replication peer is enabled.- Specified by:
isPeerEnabled
in interfaceReplicationPeerStorage
- Throws:
ReplicationException
- if there are errors accessing the storage service.
-
getPeerConfig
Description copied from interface:ReplicationPeerStorage
Get the peer config of a replication peer.- Specified by:
getPeerConfig
in interfaceReplicationPeerStorage
- Throws:
ReplicationException
- if there are errors accessing the storage service.
-