@InterfaceAudience.Private public class ReplicationPeers extends Object
| Modifier and Type | Field and Description | 
|---|---|
| private org.apache.hadoop.conf.Configuration | conf | 
| private ConcurrentMap<String,ReplicationPeerImpl> | peerCache | 
| private ReplicationPeerStorage | peerStorage | 
| Constructor and Description | 
|---|
| ReplicationPeers(ZKWatcher zookeeper,
                org.apache.hadoop.conf.Configuration conf) | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | addPeer(String peerId)Method called after a peer has been connected. | 
| private ReplicationPeerImpl | createPeer(String peerId)Helper method to connect to a peer | 
| Set<String> | getAllPeerIds()Returns the set of peerIds of the clusters that have been connected and have an underlying
 ReplicationPeer. | 
| org.apache.hadoop.conf.Configuration | getConf() | 
| ReplicationPeerImpl | getPeer(String peerId)Returns the ReplicationPeerImpl for the specified cached peer. | 
| Map<String,ReplicationPeerImpl> | getPeerCache() | 
| ReplicationPeerStorage | getPeerStorage() | 
| void | init() | 
| ReplicationPeerConfig | refreshPeerConfig(String peerId) | 
| ReplicationPeer.PeerState | refreshPeerState(String peerId) | 
| void | removePeer(String peerId) | 
private final org.apache.hadoop.conf.Configuration conf
private final ConcurrentMap<String,ReplicationPeerImpl> peerCache
private final ReplicationPeerStorage peerStorage
ReplicationPeers(ZKWatcher zookeeper, org.apache.hadoop.conf.Configuration conf)
public org.apache.hadoop.conf.Configuration getConf()
public void init() throws ReplicationException
ReplicationExceptionpublic ReplicationPeerStorage getPeerStorage()
public boolean addPeer(String peerId) throws ReplicationException
peerId - a short that identifies the clusterReplicationExceptionpublic void removePeer(String peerId)
public ReplicationPeerImpl getPeer(String peerId)
peerId - id for the peerpublic Set<String> getAllPeerIds()
public Map<String,ReplicationPeerImpl> getPeerCache()
public ReplicationPeer.PeerState refreshPeerState(String peerId) throws ReplicationException
ReplicationExceptionpublic ReplicationPeerConfig refreshPeerConfig(String peerId) throws ReplicationException
ReplicationExceptionprivate ReplicationPeerImpl createPeer(String peerId) throws ReplicationException
peerId - peer's identifierReplicationExceptionCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.