@InterfaceAudience.Private public class ReplicationPeerManager extends Object
Used to add/remove a replication peer.
Modifier and Type | Field and Description |
---|---|
private String |
clusterId |
private org.apache.hadoop.conf.Configuration |
conf |
private ConcurrentMap<String,ReplicationPeerDescription> |
peers |
private ReplicationPeerStorage |
peerStorage |
private ReplicationQueueStorage |
queueStorage |
Constructor and Description |
---|
ReplicationPeerManager(ReplicationPeerStorage peerStorage,
ReplicationQueueStorage queueStorage,
ConcurrentMap<String,ReplicationPeerDescription> peers,
org.apache.hadoop.conf.Configuration conf,
String clusterId) |
Modifier and Type | Method and Description |
---|---|
void |
addPeer(String peerId,
ReplicationPeerConfig peerConfig,
boolean enabled) |
private void |
checkClusterKey(String clusterKey) |
private void |
checkConfiguredWALEntryFilters(ReplicationPeerConfig peerConfig) |
private void |
checkNamespacesAndTableCfsConfigConflict(Set<String> namespaces,
Map<TableName,? extends Collection<String>> tableCfs)
Set a namespace in the peer config means that all tables in this namespace will be replicated
to the peer cluster.
|
private void |
checkPeerConfig(ReplicationPeerConfig peerConfig) |
private ReplicationPeerDescription |
checkPeerExists(String peerId) |
private void |
checkQueuesDeleted(String peerId) |
private void |
checkSameClusterKey(String clusterKey) |
static ReplicationPeerManager |
create(ZKWatcher zk,
org.apache.hadoop.conf.Configuration conf,
String clusterId) |
void |
disablePeer(String peerId) |
void |
enablePeer(String peerId) |
Optional<ReplicationPeerConfig> |
getPeerConfig(String peerId) |
ReplicationQueueStorage |
getQueueStorage() |
List<String> |
getSerialPeerIdsBelongsTo(TableName tableName) |
private boolean |
isStringEquals(String s1,
String s2)
For replication peer cluster key or endpoint class, null and empty string is same.
|
List<ReplicationPeerDescription> |
listPeers(Pattern pattern) |
(package private) void |
preAddPeer(String peerId,
ReplicationPeerConfig peerConfig) |
(package private) void |
preDisablePeer(String peerId) |
(package private) void |
preEnablePeer(String peerId) |
(package private) ReplicationPeerConfig |
preRemovePeer(String peerId) |
(package private) ReplicationPeerDescription |
preUpdatePeerConfig(String peerId,
ReplicationPeerConfig peerConfig)
Return the old peer description.
|
(package private) void |
removeAllLastPushedSeqIds(String peerId) |
(package private) void |
removeAllQueuesAndHFileRefs(String peerId) |
void |
removePeer(String peerId) |
private void |
setPeerState(String peerId,
boolean enabled) |
void |
updatePeerConfig(String peerId,
ReplicationPeerConfig peerConfig) |
private final ReplicationPeerStorage peerStorage
private final ReplicationQueueStorage queueStorage
private final ConcurrentMap<String,ReplicationPeerDescription> peers
private final org.apache.hadoop.conf.Configuration conf
ReplicationPeerManager(ReplicationPeerStorage peerStorage, ReplicationQueueStorage queueStorage, ConcurrentMap<String,ReplicationPeerDescription> peers, org.apache.hadoop.conf.Configuration conf, String clusterId)
private void checkQueuesDeleted(String peerId) throws ReplicationException, DoNotRetryIOException
void preAddPeer(String peerId, ReplicationPeerConfig peerConfig) throws DoNotRetryIOException, ReplicationException
private ReplicationPeerDescription checkPeerExists(String peerId) throws DoNotRetryIOException
DoNotRetryIOException
ReplicationPeerConfig preRemovePeer(String peerId) throws DoNotRetryIOException
DoNotRetryIOException
void preEnablePeer(String peerId) throws DoNotRetryIOException
DoNotRetryIOException
void preDisablePeer(String peerId) throws DoNotRetryIOException
DoNotRetryIOException
ReplicationPeerDescription preUpdatePeerConfig(String peerId, ReplicationPeerConfig peerConfig) throws DoNotRetryIOException
DoNotRetryIOException
public void addPeer(String peerId, ReplicationPeerConfig peerConfig, boolean enabled) throws ReplicationException
ReplicationException
public void removePeer(String peerId) throws ReplicationException
ReplicationException
private void setPeerState(String peerId, boolean enabled) throws ReplicationException
ReplicationException
public void enablePeer(String peerId) throws ReplicationException
ReplicationException
public void disablePeer(String peerId) throws ReplicationException
ReplicationException
public void updatePeerConfig(String peerId, ReplicationPeerConfig peerConfig) throws ReplicationException
ReplicationException
public List<ReplicationPeerDescription> listPeers(Pattern pattern)
public Optional<ReplicationPeerConfig> getPeerConfig(String peerId)
void removeAllLastPushedSeqIds(String peerId) throws ReplicationException
ReplicationException
void removeAllQueuesAndHFileRefs(String peerId) throws ReplicationException
ReplicationException
private void checkPeerConfig(ReplicationPeerConfig peerConfig) throws DoNotRetryIOException
DoNotRetryIOException
private void checkNamespacesAndTableCfsConfigConflict(Set<String> namespaces, Map<TableName,? extends Collection<String>> tableCfs) throws DoNotRetryIOException
Set a exclude namespace in the peer config means that all tables in this namespace can't be replicated to the peer cluster.
DoNotRetryIOException
private void checkConfiguredWALEntryFilters(ReplicationPeerConfig peerConfig) throws DoNotRetryIOException
DoNotRetryIOException
private void checkClusterKey(String clusterKey) throws DoNotRetryIOException
DoNotRetryIOException
private void checkSameClusterKey(String clusterKey) throws DoNotRetryIOException
DoNotRetryIOException
public List<String> getSerialPeerIdsBelongsTo(TableName tableName)
public ReplicationQueueStorage getQueueStorage()
public static ReplicationPeerManager create(ZKWatcher zk, org.apache.hadoop.conf.Configuration conf, String clusterId) throws ReplicationException
ReplicationException
private boolean isStringEquals(String s1, String s2)
StringUtils.equals(CharSequence, CharSequence)
directly.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.