@InterfaceAudience.Private
public interface ReplicationQueueStorage
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 |
addPeerToHFileRefs(String peerId)
Add a peer to hfile reference queue if peer does not exist.
|
void |
addWAL(ServerName serverName,
String queueId,
String fileName)
Add a new WAL file to the given queue for a given regionserver.
|
Pair<String,SortedSet<String>> |
claimQueue(ServerName sourceServerName,
String queueId,
ServerName destServerName)
Change ownership for the queue identified by queueId and belongs to a dead region server.
|
Set<String> |
getAllHFileRefs()
Load all hfile references in all replication queues.
|
List<String> |
getAllPeersFromHFileRefsQueue()
Get list of all peers from hfile reference queue.
|
List<String> |
getAllQueues(ServerName serverName)
Get a list of all queues for the specified region server.
|
Set<String> |
getAllWALs()
Load all wals in all replication queues.
|
long |
getLastSequenceId(String encodedRegionName,
String peerId)
Read the max sequence id of the specific region for a given peer.
|
List<ServerName> |
getListOfReplicators()
Get a list of all region servers that have outstanding replication queues.
|
List<String> |
getReplicableHFiles(String peerId)
Get a list of all hfile references in the given peer.
|
String |
getRsNode(ServerName serverName)
Get full znode name for given region server
|
long |
getWALPosition(ServerName serverName,
String queueId,
String fileName)
Get the current position for a specific WAL in a given queue for a given regionserver.
|
List<String> |
getWALsInQueue(ServerName serverName,
String queueId)
Get a list of all WALs in the given queue on the given region server.
|
void |
removeHFileRefs(String peerId,
List<String> files)
Remove hfile references from the queue.
|
void |
removeLastSequenceIds(String peerId)
Remove all the max sequence id record for the given peer.
|
void |
removeLastSequenceIds(String peerId,
List<String> encodedRegionNames)
Remove the max sequence id record for the given peer and regions.
|
void |
removePeerFromHFileRefs(String peerId)
Remove a peer from hfile reference queue.
|
void |
removeQueue(ServerName serverName,
String queueId)
Remove a replication queue for a given regionserver.
|
void |
removeReplicatorIfQueueIsEmpty(ServerName serverName)
Remove the record of region server if the queue is empty.
|
void |
removeWAL(ServerName serverName,
String queueId,
String fileName)
Remove an WAL file from the given queue for a given regionserver.
|
void |
setLastSequenceIds(String peerId,
Map<String,Long> lastSeqIds)
Set the max sequence id of a bunch of regions for a given peer.
|
void |
setWALPosition(ServerName serverName,
String queueId,
String fileName,
long position,
Map<String,Long> lastSeqIds)
Set the current position for a specific WAL in a given queue for a given regionserver.
|
void removeQueue(ServerName serverName, String queueId) throws ReplicationException
serverName
- the name of the regionserverqueueId
- a String that identifies the queue.ReplicationException
void addWAL(ServerName serverName, String queueId, String fileName) throws ReplicationException
serverName
- the name of the regionserverqueueId
- a String that identifies the queue.fileName
- name of the WALReplicationException
void removeWAL(ServerName serverName, String queueId, String fileName) throws ReplicationException
serverName
- the name of the regionserverqueueId
- a String that identifies the queue.fileName
- name of the WALReplicationException
void setWALPosition(ServerName serverName, String queueId, String fileName, long position, Map<String,Long> lastSeqIds) throws ReplicationException
serverName
- the name of the regionserverqueueId
- a String that identifies the queuefileName
- name of the WALposition
- the current position in the file. Will ignore if less than or equal to 0.lastSeqIds
- map with {encodedRegionName, sequenceId} pairs for serial replication.ReplicationException
long getLastSequenceId(String encodedRegionName, String peerId) throws ReplicationException
encodedRegionName
- the encoded region namepeerId
- peer idReplicationException
void setLastSequenceIds(String peerId, Map<String,Long> lastSeqIds) throws ReplicationException
peerId
- peer idlastSeqIds
- map with {encodedRegionName, sequenceId} pairs for serial replication.ReplicationException
void removeLastSequenceIds(String peerId) throws ReplicationException
peerId
- peer idReplicationException
void removeLastSequenceIds(String peerId, List<String> encodedRegionNames) throws ReplicationException
peerId
- peer idencodedRegionNames
- the encoded region namesReplicationException
long getWALPosition(ServerName serverName, String queueId, String fileName) throws ReplicationException
serverName
- the name of the regionserverqueueId
- a String that identifies the queuefileName
- name of the WALReplicationException
List<String> getWALsInQueue(ServerName serverName, String queueId) throws ReplicationException
serverName
- the server name of the region server that owns the queuequeueId
- a String that identifies the queueReplicationException
List<String> getAllQueues(ServerName serverName) throws ReplicationException
serverName
- the server name of the region server that owns the set of queuesReplicationException
Pair<String,SortedSet<String>> claimQueue(ServerName sourceServerName, String queueId, ServerName destServerName) throws ReplicationException
sourceServerName
- the name of the dead region serverdestServerName
- the name of the target region serverqueueId
- the id of the queueReplicationException
void removeReplicatorIfQueueIsEmpty(ServerName serverName) throws ReplicationException
ReplicationException
List<ServerName> getListOfReplicators() throws ReplicationException
ReplicationException
Set<String> getAllWALs() throws ReplicationException
ReplicationException
void 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) throws ReplicationException
peerId
- peer cluster id to be removedReplicationException
void 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 referencevoid removeHFileRefs(String peerId, List<String> files) throws ReplicationException
peerId
- peer cluster id from which this hfile references needs to be removedfiles
- list of hfile references to be removedReplicationException
List<String> getAllPeersFromHFileRefsQueue() throws ReplicationException
ReplicationException
List<String> getReplicableHFiles(String peerId) throws ReplicationException
peerId
- a String that identifies the peerReplicationException
Set<String> getAllHFileRefs() throws ReplicationException
ReplicationException
String getRsNode(ServerName serverName)
serverName
- the name of the region serverCopyright © 2007–2019 Cloudera. All rights reserved.