|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.replication.ReplicationStateZKBase
org.apache.hadoop.hbase.replication.ReplicationQueuesZKImpl
public class ReplicationQueuesZKImpl
This class provides an implementation of the ReplicationQueues interface using Zookeeper. The base znode that this class works at is the myQueuesZnode. The myQueuesZnode contains a list of all outstanding HLog files on this region server that need to be replicated. The myQueuesZnode is the regionserver name (a concatenation of the region server’s hostname, client port and start code). For example: /hbase/replication/rs/hostname.example.org,6020,1234 Within this znode, the region server maintains a set of HLog replication queues. These queues are represented by child znodes named using there give queue id. For example: /hbase/replication/rs/hostname.example.org,6020,1234/1 /hbase/replication/rs/hostname.example.org,6020,1234/2 Each queue has one child znode for every HLog that still needs to be replicated. The value of these HLog child znodes is the latest position that has been replicated. This position is updated every time a HLog entry is replicated. For example: /hbase/replication/rs/hostname.example.org,6020,1234/1/23522342.23422 [VALUE: 254]
| 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 | |
|---|---|
ReplicationQueuesZKImpl(ZooKeeperWatcher zk,
org.apache.hadoop.conf.Configuration conf,
Abortable abortable)
|
|
| Method Summary | |
|---|---|
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. |
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. |
| 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.ReplicationQueues |
|---|
getListOfReplicators |
| Constructor Detail |
|---|
public ReplicationQueuesZKImpl(ZooKeeperWatcher zk,
org.apache.hadoop.conf.Configuration conf,
Abortable abortable)
| Method Detail |
|---|
public void init(String serverName)
throws org.apache.zookeeper.KeeperException
ReplicationQueues
init in interface ReplicationQueuesserverName - The server name of the region server that owns the replication queues this
interface manages.
org.apache.zookeeper.KeeperExceptionpublic void removeQueue(String queueId)
ReplicationQueues
removeQueue in interface ReplicationQueuesqueueId - a String that identifies the queue.
public void addLog(String queueId,
String filename)
throws org.apache.zookeeper.KeeperException
ReplicationQueues
addLog in interface ReplicationQueuesqueueId - a String that identifies the queue.filename - name of the HLog
org.apache.zookeeper.KeeperException
public void removeLog(String queueId,
String filename)
ReplicationQueues
removeLog in interface ReplicationQueuesqueueId - a String that identifies the queue.filename - name of the HLog
public void setLogPosition(String queueId,
String filename,
long position)
ReplicationQueues
setLogPosition in interface ReplicationQueuesqueueId - a String that identifies the queuefilename - name of the HLogposition - the current position in the file
public long getLogPosition(String queueId,
String filename)
throws org.apache.zookeeper.KeeperException
ReplicationQueues
getLogPosition in interface ReplicationQueuesqueueId - a String that identifies the queuefilename - name of the HLog
org.apache.zookeeper.KeeperExceptionpublic SortedMap<String,SortedSet<String>> claimQueues(String regionserverZnode)
ReplicationQueues
claimQueues in interface ReplicationQueuesregionserverZnode - the id of the dead region server
public void removeAllQueues()
ReplicationQueues
removeAllQueues in interface ReplicationQueuespublic List<String> getLogsInQueue(String queueId)
ReplicationQueues
getLogsInQueue in interface ReplicationQueuesqueueId - a String that identifies the queue
public List<String> getAllQueues()
ReplicationQueues
getAllQueues in interface ReplicationQueues
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||