public class ReplicationQueuesZKImpl extends ReplicationStateZKBase implements ReplicationQueues
abortable, conf, DISABLED_ZNODE_BYTES, ENABLED_ZNODE_BYTES, ourClusterKey, peerStateNodeName, peersZNode, queuesZNode, replicationZNode, zookeeper| Constructor and Description |
|---|
ReplicationQueuesZKImpl(ZooKeeperWatcher zk,
org.apache.hadoop.conf.Configuration conf,
Abortable abortable) |
| Modifier and Type | Method and Description |
|---|---|
void |
addLog(String queueId,
String filename)
Add a new HLog file to the given queue.
|
SortedMap<String,SortedSet<String>> |
claimQueues(String regionserverZnode)
Take ownership for the set of queues belonging to a dead region server.
|
List<String> |
getAllQueues()
Get a list of all queues for this region server.
|
long |
getLogPosition(String queueId,
String filename)
Get the current position for a specific HLog in a given queue.
|
List<String> |
getLogsInQueue(String queueId)
Get a list of all HLogs in the given queue.
|
void |
init(String serverName)
Initialize the region server replication queue interface.
|
boolean |
isThisOurZnode(String znode)
Checks if the provided znode is the same as this region server's
|
void |
removeAllQueues()
Remove all replication queues for this region server.
|
void |
removeLog(String queueId,
String filename)
Remove an HLog file from the given queue.
|
void |
removeQueue(String queueId)
Remove a replication queue.
|
void |
setLogPosition(String queueId,
String filename,
long position)
Set the current position for a specific HLog in a given queue.
|
getListOfReplicators, isPeerPath, peerExists, toByteArrayclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetListOfReplicatorspublic ReplicationQueuesZKImpl(ZooKeeperWatcher zk, org.apache.hadoop.conf.Configuration conf, Abortable abortable)
public void init(String serverName) throws ReplicationException
ReplicationQueuesinit in interface ReplicationQueuesserverName - The server name of the region server that owns the replication queues this
interface manages.ReplicationExceptionpublic void removeQueue(String queueId)
ReplicationQueuesremoveQueue in interface ReplicationQueuesqueueId - a String that identifies the queue.public void addLog(String queueId, String filename) throws ReplicationException
ReplicationQueuesaddLog in interface ReplicationQueuesqueueId - a String that identifies the queue.filename - name of the HLogReplicationExceptionpublic void removeLog(String queueId, String filename)
ReplicationQueuesremoveLog in interface ReplicationQueuesqueueId - a String that identifies the queue.filename - name of the HLogpublic void setLogPosition(String queueId, String filename, long position)
ReplicationQueuessetLogPosition in interface ReplicationQueuesqueueId - a String that identifies the queuefilename - name of the HLogposition - the current position in the filepublic long getLogPosition(String queueId, String filename) throws ReplicationException
ReplicationQueuesgetLogPosition in interface ReplicationQueuesqueueId - a String that identifies the queuefilename - name of the HLogReplicationExceptionpublic boolean isThisOurZnode(String znode)
ReplicationQueuesisThisOurZnode in interface ReplicationQueuesznode - to checkpublic SortedMap<String,SortedSet<String>> claimQueues(String regionserverZnode)
ReplicationQueuesclaimQueues in interface ReplicationQueuesregionserverZnode - the id of the dead region serverpublic void removeAllQueues()
ReplicationQueuesremoveAllQueues in interface ReplicationQueuespublic List<String> getLogsInQueue(String queueId)
ReplicationQueuesgetLogsInQueue in interface ReplicationQueuesqueueId - a String that identifies the queuepublic List<String> getAllQueues()
ReplicationQueuesgetAllQueues in interface ReplicationQueuesCopyright © 2014 The Apache Software Foundation. All rights reserved.