@InterfaceAudience.Private public interface ReplicationPeers
| Modifier and Type | Method and Description |
|---|---|
void |
addPeer(java.lang.String peerId,
ReplicationPeerConfig peerConfig,
java.lang.String tableCFs)
Add a new remote slave cluster for replication.
|
void |
disablePeer(java.lang.String peerId)
Stop the replication to the specified remote slave cluster.
|
void |
enablePeer(java.lang.String peerId)
Restart the replication to the specified remote slave cluster.
|
java.util.Map<java.lang.String,ReplicationPeerConfig> |
getAllPeerConfigs()
List the cluster replication configs of all remote slave clusters (whether they are
enabled/disabled or connected/disconnected).
|
java.util.List<java.lang.String> |
getAllPeerIds()
List the peer ids of all remote slave clusters (whether they are enabled/disabled or
connected/disconnected).
|
ReplicationPeer |
getPeer(java.lang.String peerId)
Returns the ReplicationPeer
|
Pair<ReplicationPeerConfig,Configuration> |
getPeerConf(java.lang.String peerId)
Returns the configuration needed to talk to the remote slave cluster.
|
java.util.Set<java.lang.String> |
getPeerIds()
Returns the set of peerIds defined
|
java.lang.String |
getPeerTableCFsConfig(java.lang.String peerId)
Get the table and column-family list string of the peer from ZK.
|
ReplicationPeerConfig |
getReplicationPeerConfig(java.lang.String peerId)
Returns the configured ReplicationPeerConfig for this peerId
|
boolean |
getStatusOfPeer(java.lang.String peerId)
Get the replication status for the specified connected remote slave cluster.
|
boolean |
getStatusOfPeerFromBackingStore(java.lang.String peerId)
Get the replication status for the specified remote slave cluster, which doesn't
have to be connected.
|
java.util.Map<TableName,java.util.List<java.lang.String>> |
getTableCFs(java.lang.String peerId)
Get the table and column-family-list map of the peer.
|
void |
init()
Initialize the ReplicationPeers interface.
|
boolean |
peerAdded(java.lang.String peerId) |
void |
peerRemoved(java.lang.String peerId) |
void |
removePeer(java.lang.String peerId)
Removes a remote slave cluster and stops the replication to it.
|
void |
setPeerTableCFsConfig(java.lang.String peerId,
java.lang.String tableCFs)
Set the table and column-family list string of the peer to ZK.
|
void init() throws ReplicationException
ReplicationExceptionvoid addPeer(java.lang.String peerId,
ReplicationPeerConfig peerConfig,
java.lang.String tableCFs)
throws ReplicationException
peerId - a short that identifies the clusterpeerConfig - configuration for the replication slave clustertableCFs - the table and column-family list which will be replicated for this peer or null
for all table and column familiesReplicationExceptionvoid removePeer(java.lang.String peerId)
throws ReplicationException
peerId - a short that identifies the clusterReplicationExceptionboolean peerAdded(java.lang.String peerId)
throws ReplicationException
ReplicationExceptionvoid peerRemoved(java.lang.String peerId)
void enablePeer(java.lang.String peerId)
throws ReplicationException
peerId - a short that identifies the clusterReplicationExceptionvoid disablePeer(java.lang.String peerId)
throws ReplicationException
peerId - a short that identifies the clusterReplicationExceptionjava.lang.String getPeerTableCFsConfig(java.lang.String peerId)
throws ReplicationException
peerId - a short that identifies the clusterReplicationExceptionvoid setPeerTableCFsConfig(java.lang.String peerId,
java.lang.String tableCFs)
throws ReplicationException
peerId - a short that identifies the clustertableCFs - the table and column-family list which will be replicated for this peerReplicationExceptionjava.util.Map<TableName,java.util.List<java.lang.String>> getTableCFs(java.lang.String peerId)
peerId - a short that identifies the clusterReplicationPeer getPeer(java.lang.String peerId)
peerId - id for the peerjava.util.Set<java.lang.String> getPeerIds()
boolean getStatusOfPeer(java.lang.String peerId)
getStatusOfPeerFromBackingStore(String)
if reading the state after enabling or disabling it.peerId - a short that identifies the clusterboolean getStatusOfPeerFromBackingStore(java.lang.String peerId)
throws ReplicationException
peerId - a short that identifies the clusterIOException - Throws if there's an error contacting the storeReplicationExceptionjava.util.Map<java.lang.String,ReplicationPeerConfig> getAllPeerConfigs()
java.util.List<java.lang.String> getAllPeerIds()
ReplicationPeerConfig getReplicationPeerConfig(java.lang.String peerId) throws ReplicationException
peerId - a short name that identifies the clusterReplicationExceptionPair<ReplicationPeerConfig,Configuration> getPeerConf(java.lang.String peerId) throws ReplicationException
peerId - a short that identifies the clusterReplicationException