public class ReplicationPeersZKImpl extends ReplicationStateZKBase implements ReplicationPeers
| Modifier and Type | Class and Description |
|---|---|
static class |
ReplicationPeersZKImpl.PeerRegionServerListener
Tracks changes to the list of region servers in a peer's cluster.
|
abortable, conf, DISABLED_ZNODE_BYTES, ENABLED_ZNODE_BYTES, ourClusterKey, peerStateNodeName, peersZNode, queuesZNode, replicationZNode, zookeeper| Constructor and Description |
|---|
ReplicationPeersZKImpl(ZooKeeperWatcher zk,
org.apache.hadoop.conf.Configuration conf,
Abortable abortable) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPeer(String id,
String clusterKey)
Add a new remote slave cluster for replication.
|
void |
addPeer(String id,
String clusterKey,
String tableCFs)
Add a new remote slave cluster for replication.
|
boolean |
connectToPeer(String peerId)
Attempt to connect to a new remote slave cluster.
|
void |
disablePeer(String id)
Stop the replication to the specified remote slave cluster.
|
void |
disconnectFromPeer(String peerId)
Disconnect from a remote slave cluster.
|
void |
enablePeer(String id)
Restart the replication to the specified remote slave cluster.
|
Map<String,String> |
getAllPeerClusterKeys()
List the cluster keys of all remote slave clusters (whether they are enabled/disabled or
connected/disconnected).
|
List<String> |
getAllPeerIds()
List all registered peer clusters and set a watch on their znodes.
|
Set<String> |
getConnectedPeers()
Get a set of all connected remote slave clusters.
|
org.apache.hadoop.conf.Configuration |
getPeerConf(String peerId)
Returns the configuration needed to talk to the remote slave cluster.
|
String |
getPeerTableCFsConfig(String id)
Get the table and column-family list string of the peer from ZK.
|
UUID |
getPeerUUID(String peerId)
Returns the UUID of the provided peer id.
|
List<ServerName> |
getRegionServersOfConnectedPeer(String peerId)
Returns all region servers from given connected remote slave cluster.
|
boolean |
getStatusOfConnectedPeer(String id)
Get the replication status for the specified connected remote slave cluster.
|
boolean |
getStatusOfPeerFromBackingStore(String id)
Get the replication status for the specified remote slave cluster, which doesn't
have to be connected.
|
Map<String,List<String>> |
getTableCFs(String id)
Get the table and column-family-list map of the peer.
|
long |
getTimestampOfLastChangeToPeer(String peerId)
Get the timestamp of the last change in composition of a given peer cluster.
|
void |
init()
Initialize the ReplicationPeers interface.
|
void |
removePeer(String id)
Removes a remote slave cluster and stops the replication to it.
|
void |
setPeerTableCFsConfig(String id,
String tableCFsStr)
Set the table and column-family list string of the peer to ZK.
|
getListOfReplicators, isPeerPath, peerExists, toByteArraypublic ReplicationPeersZKImpl(ZooKeeperWatcher zk, org.apache.hadoop.conf.Configuration conf, Abortable abortable)
public void init()
throws ReplicationException
ReplicationPeersinit in interface ReplicationPeersReplicationExceptionpublic void addPeer(String id, String clusterKey) throws ReplicationException
ReplicationPeersaddPeer in interface ReplicationPeersid - a short that identifies the clusterclusterKey - the concatenation of the slave cluster's:
hbase.zookeeper.quorum:hbase.zookeeper.property.clientPort:zookeeper.znode.parentReplicationExceptionpublic void addPeer(String id, String clusterKey, String tableCFs) throws ReplicationException
ReplicationPeersaddPeer in interface ReplicationPeersid - a short that identifies the clusterclusterKey - the concatenation of the slave cluster's:
hbase.zookeeper.quorum:hbase.zookeeper.property.clientPort:zookeeper.znode.parenttableCFs - the table and column-family list which will be replicated for this peerReplicationExceptionpublic void removePeer(String id) throws ReplicationException
ReplicationPeersremovePeer in interface ReplicationPeersid - a short that identifies the clusterReplicationExceptionpublic void enablePeer(String id) throws ReplicationException
ReplicationPeersenablePeer in interface ReplicationPeersid - a short that identifies the clusterReplicationExceptionpublic void disablePeer(String id) throws ReplicationException
ReplicationPeersdisablePeer in interface ReplicationPeersid - a short that identifies the clusterReplicationExceptionpublic String getPeerTableCFsConfig(String id) throws ReplicationException
ReplicationPeersgetPeerTableCFsConfig in interface ReplicationPeersid - a short that identifies the clusterReplicationExceptionpublic void setPeerTableCFsConfig(String id, String tableCFsStr) throws ReplicationException
ReplicationPeerssetPeerTableCFsConfig in interface ReplicationPeersid - a short that identifies the clustertableCFsStr - the table and column-family list which will be replicated for this peerReplicationExceptionpublic Map<String,List<String>> getTableCFs(String id) throws IllegalArgumentException
ReplicationPeersgetTableCFs in interface ReplicationPeersid - a short that identifies the clusterIllegalArgumentExceptionpublic boolean getStatusOfConnectedPeer(String id)
ReplicationPeersReplicationPeers.getStatusOfPeerFromBackingStore(String)
if reading the state after enabling or disabling it.getStatusOfConnectedPeer in interface ReplicationPeersid - a short that identifies the clusterpublic boolean getStatusOfPeerFromBackingStore(String id) throws ReplicationException
ReplicationPeersgetStatusOfPeerFromBackingStore in interface ReplicationPeersid - a short that identifies the clusterReplicationExceptionpublic boolean connectToPeer(String peerId) throws ReplicationException
ReplicationPeersconnectToPeer in interface ReplicationPeerspeerId - a short that identifies the clusterReplicationExceptionpublic void disconnectFromPeer(String peerId)
ReplicationPeersdisconnectFromPeer in interface ReplicationPeerspeerId - a short that identifies the clusterpublic Map<String,String> getAllPeerClusterKeys()
ReplicationPeersgetAllPeerClusterKeys in interface ReplicationPeerspublic List<ServerName> getRegionServersOfConnectedPeer(String peerId)
ReplicationPeersgetRegionServersOfConnectedPeer in interface ReplicationPeerspeerId - a short that identifies the clusterpublic UUID getPeerUUID(String peerId)
ReplicationPeersgetPeerUUID in interface ReplicationPeerspeerId - the peer's ID that will be converted into a UUIDpublic Set<String> getConnectedPeers()
ReplicationPeersgetConnectedPeers in interface ReplicationPeerspublic org.apache.hadoop.conf.Configuration getPeerConf(String peerId) throws ReplicationException
ReplicationPeersgetPeerConf in interface ReplicationPeerspeerId - a short that identifies the clusterReplicationExceptionpublic List<String> getAllPeerIds()
getAllPeerIds in interface ReplicationPeerspublic long getTimestampOfLastChangeToPeer(String peerId)
ReplicationPeersgetTimestampOfLastChangeToPeer in interface ReplicationPeerspeerId - identifier of the peer cluster for which the timestamp is requestedCopyright © 2014 The Apache Software Foundation. All rights reserved.