org.apache.hadoop.hbase.replication
Class ReplicationQueuesClientZKImpl

java.lang.Object
  extended by org.apache.hadoop.hbase.replication.ReplicationStateZKBase
      extended by org.apache.hadoop.hbase.replication.ReplicationQueuesClientZKImpl
All Implemented Interfaces:
ReplicationQueuesClient

@InterfaceAudience.Private
public class ReplicationQueuesClientZKImpl
extends ReplicationStateZKBase
implements ReplicationQueuesClient


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.replication.ReplicationStateZKBase
abortable, conf, DISABLED_ZNODE_BYTES, ENABLED_ZNODE_BYTES, ourClusterKey, peerStateNodeName, peersZNode, queuesZNode, replicationZNode, zookeeper
 
Constructor Summary
ReplicationQueuesClientZKImpl(ZooKeeperWatcher zk, org.apache.hadoop.conf.Configuration conf, Abortable abortable)
           
 
Method Summary
 List<String> getAllQueues(String serverName)
          Get a list of all queues for the specified region server.
 List<String> getLogsInQueue(String serverName, String queueId)
          Get a list of all HLogs in the given queue on the given region server.
 int getQueuesZNodeCversion()
          Get the cversion of replication rs node.
 void init()
          Initialize the replication queue client interface.
 
Methods inherited from class org.apache.hadoop.hbase.replication.ReplicationStateZKBase
getListOfReplicators, isPeerPath, peerExists, toByteArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.hbase.replication.ReplicationQueuesClient
getListOfReplicators
 

Constructor Detail

ReplicationQueuesClientZKImpl

public ReplicationQueuesClientZKImpl(ZooKeeperWatcher zk,
                                     org.apache.hadoop.conf.Configuration conf,
                                     Abortable abortable)
Method Detail

init

public void init()
          throws ReplicationException
Description copied from interface: ReplicationQueuesClient
Initialize the replication queue client interface.

Specified by:
init in interface ReplicationQueuesClient
Throws:
ReplicationException

getLogsInQueue

public List<String> getLogsInQueue(String serverName,
                                   String queueId)
                            throws org.apache.zookeeper.KeeperException
Description copied from interface: ReplicationQueuesClient
Get a list of all HLogs in the given queue on the given region server.

Specified by:
getLogsInQueue in interface ReplicationQueuesClient
Parameters:
serverName - the server name of the region server that owns the queue
queueId - a String that identifies the queue
Returns:
a list of WALs, null if this region server is dead and has no outstanding queues
Throws:
org.apache.zookeeper.KeeperException - zookeeper exception

getAllQueues

public List<String> getAllQueues(String serverName)
                          throws org.apache.zookeeper.KeeperException
Description copied from interface: ReplicationQueuesClient
Get a list of all queues for the specified region server.

Specified by:
getAllQueues in interface ReplicationQueuesClient
Parameters:
serverName - the server name of the region server that owns the set of queues
Returns:
a list of queueIds, null if this region server is not a replicator.
Throws:
org.apache.zookeeper.KeeperException

getQueuesZNodeCversion

public int getQueuesZNodeCversion()
                           throws org.apache.zookeeper.KeeperException
Description copied from interface: ReplicationQueuesClient
Get the cversion of replication rs node. This can be used as optimistic locking to get a consistent snapshot of the replication queues.

Specified by:
getQueuesZNodeCversion in interface ReplicationQueuesClient
Returns:
cversion of replication rs node
Throws:
org.apache.zookeeper.KeeperException


Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.