org.apache.hadoop.hbase.replication
Class ReplicationStateZKBase

java.lang.Object
  extended by org.apache.hadoop.hbase.replication.ReplicationStateZKBase
Direct Known Subclasses:
ReplicationPeersZKImpl, ReplicationQueuesClientZKImpl, ReplicationQueuesZKImpl, ReplicationStateImpl, ReplicationZookeeper

public abstract class ReplicationStateZKBase
extends Object

This is a base class for maintaining replication state in zookeeper.


Field Summary
protected  Abortable abortable
           
protected  org.apache.hadoop.conf.Configuration conf
           
protected static byte[] DISABLED_ZNODE_BYTES
           
static byte[] ENABLED_ZNODE_BYTES
           
protected  String ourClusterKey
          The cluster key of the local cluster
protected  String peerStateNodeName
          The name of the znode that contains the replication status of a remote slave (i.e.
protected  String peersZNode
          The name of the znode that contains a list of all remote slave (i.e.
protected  String queuesZNode
          The name of the znode that contains all replication queues
protected  String replicationZNode
          The name of the base znode that contains all replication state.
protected  String stateZNode
          The name of the znode that contains the replication status of the local cluster.
protected  ZooKeeperWatcher zookeeper
           
 
Constructor Summary
ReplicationStateZKBase(ZooKeeperWatcher zookeeper, org.apache.hadoop.conf.Configuration conf, Abortable abortable)
           
 
Method Summary
 List<String> getListOfReplicators()
           
 boolean peerExists(String id)
           
protected static byte[] toByteArray(ZooKeeperProtos.ReplicationState.State state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

peerStateNodeName

protected final String peerStateNodeName
The name of the znode that contains the replication status of a remote slave (i.e. peer) cluster.


stateZNode

protected final String stateZNode
The name of the znode that contains the replication status of the local cluster.


replicationZNode

protected final String replicationZNode
The name of the base znode that contains all replication state.


peersZNode

protected final String peersZNode
The name of the znode that contains a list of all remote slave (i.e. peer) clusters.


queuesZNode

protected final String queuesZNode
The name of the znode that contains all replication queues


ourClusterKey

protected final String ourClusterKey
The cluster key of the local cluster


zookeeper

protected final ZooKeeperWatcher zookeeper

conf

protected final org.apache.hadoop.conf.Configuration conf

abortable

protected final Abortable abortable

ENABLED_ZNODE_BYTES

public static final byte[] ENABLED_ZNODE_BYTES

DISABLED_ZNODE_BYTES

protected static final byte[] DISABLED_ZNODE_BYTES
Constructor Detail

ReplicationStateZKBase

public ReplicationStateZKBase(ZooKeeperWatcher zookeeper,
                              org.apache.hadoop.conf.Configuration conf,
                              Abortable abortable)
Method Detail

getListOfReplicators

public List<String> getListOfReplicators()

toByteArray

protected static byte[] toByteArray(ZooKeeperProtos.ReplicationState.State state)
Parameters:
state -
Returns:
Serialized protobuf of state with pb magic prefix prepended suitable for use as content of either the cluster state znode -- whether or not we should be replicating kept in /hbase/replication/state -- or as content of a peer-state znode under a peer cluster id as in /hbase/replication/peers/PEER_ID/peer-state.

peerExists

public boolean peerExists(String id)
                   throws org.apache.zookeeper.KeeperException
Throws:
org.apache.zookeeper.KeeperException


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