Modifier and Type | Class and Description |
---|---|
class |
ReplicationPeer.PeerStateTracker
Tracker for state of this peer
|
Constructor and Description |
---|
ReplicationPeer(org.apache.hadoop.conf.Configuration conf,
String key,
String id)
Constructor that takes all the objects required to communicate with the
specified peer, except for the region server addresses.
|
Modifier and Type | Method and Description |
---|---|
void |
abort(String why,
Throwable e)
Abort the server or client.
|
String |
getClusterKey()
Get the cluster key of that peer
|
org.apache.hadoop.conf.Configuration |
getConfiguration()
Get the configuration object required to communicate with this peer
|
String |
getId()
Get the identifier of this peer
|
AtomicBoolean |
getPeerEnabled()
Get the state of this peer
|
List<ServerName> |
getRegionServers()
Get a list of all the addresses of all the region servers
for this peer cluster
|
ZooKeeperWatcher |
getZkw()
Get the ZK connection to this peer
|
boolean |
isAborted()
Check if the server or client was aborted.
|
void |
reloadZkWatcher()
Closes the current ZKW (if not null) and creates a new one
|
void |
setRegionServers(List<ServerName> regionServers)
Set the list of region servers for that peer
|
void |
startStateTracker(ZooKeeperWatcher zookeeper,
String peerStateNode)
start a state tracker to check whether this peer is enabled or not
|
public ReplicationPeer(org.apache.hadoop.conf.Configuration conf, String key, String id) throws IOException
conf
- configuration object to this peerkey
- cluster key used to locate the peerid
- string representation of this peer's identifierIOException
public void startStateTracker(ZooKeeperWatcher zookeeper, String peerStateNode) throws org.apache.zookeeper.KeeperException
zookeeper
- zk watcher for the local clusterpeerStateNode
- path to zk node which stores peer stateorg.apache.zookeeper.KeeperException
public String getClusterKey()
public AtomicBoolean getPeerEnabled()
public List<ServerName> getRegionServers()
public void setRegionServers(List<ServerName> regionServers)
regionServers
- list of addresses for the region serverspublic ZooKeeperWatcher getZkw()
public String getId()
public org.apache.hadoop.conf.Configuration getConfiguration()
public void abort(String why, Throwable e)
Abortable
public void reloadZkWatcher() throws IOException
IOException
- If anything goes wrong connectingCopyright © 2014 The Apache Software Foundation. All Rights Reserved.