@InterfaceAudience.Private public interface ReplicationQueues
Modifier and Type | Method and Description |
---|---|
void |
addHFileRefs(String peerId,
List<Pair<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.Path>> pairs)
Add new hfile references to the queue.
|
void |
addLog(String queueId,
String filename)
Add a new WAL file to the given queue.
|
void |
addPeerToHFileRefs(String peerId)
Add a peer to hfile reference queue if peer does not exist.
|
Pair<String,SortedSet<String>> |
claimQueue(String regionserver,
String queueId)
Take ownership for the queue identified by queueId and belongs to a dead region server.
|
List<String> |
getAllQueues()
Get a list of all queues for this region server.
|
List<String> |
getListOfReplicators()
Get a list of all region servers that have outstanding replication queues.
|
long |
getLogPosition(String queueId,
String filename)
Get the current position for a specific WAL in a given queue.
|
List<String> |
getLogsInQueue(String queueId)
Get a list of all WALs in the given queue.
|
List<String> |
getUnClaimedQueueIds(String regionserver)
Get queueIds from a dead region server, whose queues has not been claimed by other region
servers.
|
void |
init(String serverName)
Initialize the region server replication queue interface.
|
boolean |
isThisOurRegionServer(String regionserver)
Checks if the provided znode is the same as this region server's
|
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 |
removeHFileRefs(String peerId,
List<String> files)
Remove hfile references from the queue.
|
void |
removeLog(String queueId,
String filename)
Remove an WAL file from the given queue.
|
void |
removePeerFromHFileRefs(String peerId)
Remove a peer from hfile reference queue.
|
void |
removeQueue(String queueId)
Remove a replication queue.
|
void |
removeReplicatorIfQueueIsEmpty(String regionserver)
Remove the znode of region server if the queue is empty.
|
void |
setLogPosition(String queueId,
String filename,
long position)
Set the current position for a specific WAL in a given queue.
|
void init(String serverName) throws ReplicationException
serverName
- The server name of the region server that owns the replication queues this
interface manages.ReplicationException
void removeQueue(String queueId)
queueId
- a String that identifies the queue.void addLog(String queueId, String filename) throws ReplicationException
queueId
- a String that identifies the queue.filename
- name of the WALReplicationException
void removeLog(String queueId, String filename)
queueId
- a String that identifies the queue.filename
- name of the WALvoid setLogPosition(String queueId, String filename, long position)
queueId
- a String that identifies the queuefilename
- name of the WALposition
- the current position in the filelong getLogPosition(String queueId, String filename) throws ReplicationException
queueId
- a String that identifies the queuefilename
- name of the WALReplicationException
void removeAllQueues()
List<String> getLogsInQueue(String queueId)
queueId
- a String that identifies the queueList<String> getAllQueues()
boolean isThisOurRegionServer(String regionserver)
regionserver
- the id of the region serverList<String> getUnClaimedQueueIds(String regionserver)
Pair<String,SortedSet<String>> claimQueue(String regionserver, String queueId)
regionserver
- the id of the dead region serverqueueId
- the id of the queuevoid removeReplicatorIfQueueIsEmpty(String regionserver)
regionserver
- List<String> getListOfReplicators() throws ReplicationException
ReplicationException
boolean isThisOurZnode(String znode)
znode
- to checkvoid addPeerToHFileRefs(String peerId) throws ReplicationException
peerId
- peer cluster id to be addedReplicationException
- if fails to add a peer id to hfile reference queuevoid removePeerFromHFileRefs(String peerId)
peerId
- peer cluster id to be removedvoid addHFileRefs(String peerId, List<Pair<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.Path>> pairs) throws ReplicationException
peerId
- peer cluster id to which the hfiles need to be replicatedpairs
- list of pairs of { HFile location in staging dir, HFile path in region dir which
will be added in the queue }ReplicationException
- if fails to add a hfile referenceCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.