@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 |
batchUpdateHFileRefs(String peerId,
List<String> hfileRefs)
Add the given hfile refs to the given peer.
|
void |
batchUpdateLastSequenceIds(List<ZKReplicationQueueStorageForMigration.ZkLastPushedSeqId> lastPushedSeqIds)
Update last pushed sequence id for the given regions and peers.
|
void |
batchUpdateQueues(ServerName serverName,
List<ReplicationQueueData> datas)
Update the replication queue datas for a given region server.
|
Map<String,ReplicationGroupOffset> |
claimQueue(ReplicationQueueId queueId,
ServerName targetServerName)
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.
|
long |
getLastSequenceId(String encodedRegionName,
String peerId)
Read the max sequence id of the specific region for a given peer.
|
Map<String,ReplicationGroupOffset> |
getOffsets(ReplicationQueueId queueId)
Get the current offset of all the WAL groups for a queue
|
List<String> |
getReplicableHFiles(String peerId)
Get a list of all hfile references in the given peer.
|
boolean |
hasData()
Whether the replication queue table exists.
|
List<ReplicationQueueId> |
listAllQueueIds(ServerName serverName)
Get a list of all queues for the specific region server.
|
List<ReplicationQueueId> |
listAllQueueIds(String peerId)
Get a list of all queues for the specific peer.
|
List<ReplicationQueueId> |
listAllQueueIds(String peerId,
ServerName serverName)
Get a list of all queues for the specific region server and the specific peer
|
List<ReplicationQueueData> |
listAllQueues()
Get a list of all queues and the offsets.
|
List<ServerName> |
listAllReplicators()
Get a list of all region servers that have outstanding replication queues.
|
void |
removeAllQueues(String peerId)
Remove all the replication queues for the given peer.
|
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 |
removeLastSequenceIdsAndHFileRefsBefore(long ts)
Remove all the last sequence ids and hfile references data which are written before the given
timestamp.
|
void |
removePeerFromHFileRefs(String peerId)
Remove a peer from hfile reference queue.
|
void |
removeQueue(ReplicationQueueId queueId)
Remove a replication queue
|
void |
setLastSequenceIds(String peerId,
Map<String,Long> lastSeqIds)
Set the max sequence id of a bunch of regions for a given peer.
|
void |
setOffset(ReplicationQueueId queueId,
String walGroup,
ReplicationGroupOffset offset,
Map<String,Long> lastSeqIds)
Set the current offset for a specific WAL group in a given queue.
|
void setOffset(ReplicationQueueId queueId, String walGroup, ReplicationGroupOffset offset, Map<String,Long> lastSeqIds) throws ReplicationException
queueId
- the id of the queuewalGroup
- the group of the WAL, can be empty if multi wal is not enabledoffset
- the current offset of replication progresslastSeqIds
- map with {encodedRegionName, sequenceId} pairs for serial replication.ReplicationException
Map<String,ReplicationGroupOffset> getOffsets(ReplicationQueueId queueId) throws ReplicationException
queueId
- the id of the queueReplicationException
List<ReplicationQueueId> listAllQueueIds(String peerId) throws ReplicationException
peerId
- the id of the peerReplicationException
List<ReplicationQueueId> listAllQueueIds(ServerName serverName) throws ReplicationException
serverName
- the server name of the region server that owns the set of queuesReplicationException
List<ReplicationQueueId> listAllQueueIds(String peerId, ServerName serverName) throws ReplicationException
peerId
- the id of the peerserverName
- the server name of the region server that owns the set of queuesReplicationException
List<ReplicationQueueData> listAllQueues() throws ReplicationException
ReplicationException
List<ServerName> listAllReplicators() throws ReplicationException
ReplicationException
Map<String,ReplicationGroupOffset> claimQueue(ReplicationQueueId queueId, ServerName targetServerName) throws ReplicationException
queueId
- the id of the queuetargetServerName
- the name of the target region serverReplicationException
void removeQueue(ReplicationQueueId queueId) throws ReplicationException
queueId
- the id of the queue to removeReplicationException
void removeAllQueues(String peerId) throws ReplicationException
peerId
- the id of the peerReplicationException
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
void 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
boolean hasData() throws ReplicationException
ReplicationException
void batchUpdateQueues(ServerName serverName, List<ReplicationQueueData> datas) throws ReplicationException
ReplicationException
void batchUpdateLastSequenceIds(List<ZKReplicationQueueStorageForMigration.ZkLastPushedSeqId> lastPushedSeqIds) throws ReplicationException
ReplicationException
void batchUpdateHFileRefs(String peerId, List<String> hfileRefs) throws ReplicationException
ReplicationException
void removeLastSequenceIdsAndHFileRefsBefore(long ts) throws ReplicationException
ReplicationException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.