org.apache.hadoop.hbase.replication
Class ReplicationPeer

java.lang.Object
  extended by org.apache.hadoop.hbase.replication.ReplicationPeer

public class ReplicationPeer
extends Object

This class acts as a wrapper for all the objects used to identify and communicate with remote peers. Everything needs to be created for objects of this class as it doesn't encapsulate any specific functionality e.g. it's a container class.


Constructor Summary
ReplicationPeer(org.apache.hadoop.conf.Configuration conf, String key, String id, ZooKeeperWatcher zkw)
          Constructor that takes all the objects required to communicate with the specified peer, except for the region server addresses.
 
Method Summary
 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<HServerAddress> 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
 void setRegionServers(List<HServerAddress> regionServers)
          Set the list of region servers for that peer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicationPeer

public ReplicationPeer(org.apache.hadoop.conf.Configuration conf,
                       String key,
                       String id,
                       ZooKeeperWatcher zkw)
Constructor that takes all the objects required to communicate with the specified peer, except for the region server addresses.

Parameters:
conf - configuration object to this peer
key - cluster key used to locate the peer
id - string representation of this peer's identifier
zkw - zookeeper connection to the peer
Method Detail

getClusterKey

public String getClusterKey()
Get the cluster key of that peer

Returns:
string consisting of zk ensemble addresses, client port and root znode

getPeerEnabled

public AtomicBoolean getPeerEnabled()
Get the state of this peer

Returns:
atomic boolean that holds the status

getRegionServers

public List<HServerAddress> getRegionServers()
Get a list of all the addresses of all the region servers for this peer cluster

Returns:
list of addresses

setRegionServers

public void setRegionServers(List<HServerAddress> regionServers)
Set the list of region servers for that peer

Parameters:
regionServers - list of addresses for the region servers

getZkw

public ZooKeeperWatcher getZkw()
Get the ZK connection to this peer

Returns:
zk connection

getId

public String getId()
Get the identifier of this peer

Returns:
string representation of the id (short)

getConfiguration

public org.apache.hadoop.conf.Configuration getConfiguration()
Get the configuration object required to communicate with this peer

Returns:
configuration object


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.