Class NoopReplicationQueueStorage
java.lang.Object
org.apache.hadoop.hbase.replication.regionserver.NoopReplicationQueueStorage
- All Implemented Interfaces:
ReplicationQueueStorage
Noop queue storage -- does nothing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHFileRefs(String peerId, List<Pair<org.apache.hadoop.fs.Path, org.apache.hadoop.fs.Path>> pairs) Add new hfile references to the queue.voidaddPeerToHFileRefs(String peerId) Add a peer to hfile reference queue if peer does not exist.voidaddWAL(ServerName serverName, String queueId, String fileName) Add a new WAL file to the given queue for a given regionserver.claimQueue(ServerName sourceServerName, String queueId, ServerName destServerName) Change ownership for the queue identified by queueId and belongs to a dead region server.Load all hfile references in all replication queues.Get list of all peers from hfile reference queue.getAllQueues(ServerName serverName) Get a list of all queues for the specified region server.Load all wals in all replication queues.longgetLastSequenceId(String encodedRegionName, String peerId) Read the max sequence id of the specific region for a given peer.Get a list of all region servers that have outstanding replication queues.getReplicableHFiles(String peerId) Get a list of all hfile references in the given peer.getRsNode(ServerName serverName) Get full znode name for given region serverlonggetWALPosition(ServerName serverName, String queueId, String fileName) Get the current position for a specific WAL in a given queue for a given regionserver.getWALsInQueue(ServerName serverName, String queueId) Get a list of all WALs in the given queue on the given region server.voidremoveHFileRefs(String peerId, List<String> files) Remove hfile references from the queue.voidremoveLastSequenceIds(String peerId) Remove all the max sequence id record for the given peer.voidremoveLastSequenceIds(String peerId, List<String> encodedRegionNames) Remove the max sequence id record for the given peer and regions.voidremovePeerFromHFileRefs(String peerId) Remove a peer from hfile reference queue.voidremoveQueue(ServerName serverName, String queueId) Remove a replication queue for a given regionserver.voidremoveReplicatorIfQueueIsEmpty(ServerName serverName) Remove the record of region server if the queue is empty.voidremoveWAL(ServerName serverName, String queueId, String fileName) Remove an WAL file from the given queue for a given regionserver.voidsetLastSequenceIds(String peerId, Map<String, Long> lastSeqIds) Set the max sequence id of a bunch of regions for a given peer.voidsetWALPosition(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.
-
Constructor Details
-
NoopReplicationQueueStorage
-
-
Method Details
-
removeQueue
Description copied from interface:ReplicationQueueStorageRemove a replication queue for a given regionserver.- Specified by:
removeQueuein interfaceReplicationQueueStorage- Parameters:
serverName- the name of the regionserverqueueId- a String that identifies the queue.- Throws:
ReplicationException
-
addWAL
public void addWAL(ServerName serverName, String queueId, String fileName) throws ReplicationException Description copied from interface:ReplicationQueueStorageAdd a new WAL file to the given queue for a given regionserver. If the queue does not exist it is created.- Specified by:
addWALin interfaceReplicationQueueStorage- Parameters:
serverName- the name of the regionserverqueueId- a String that identifies the queue.fileName- name of the WAL- Throws:
ReplicationException
-
removeWAL
public void removeWAL(ServerName serverName, String queueId, String fileName) throws ReplicationException Description copied from interface:ReplicationQueueStorageRemove an WAL file from the given queue for a given regionserver.- Specified by:
removeWALin interfaceReplicationQueueStorage- Parameters:
serverName- the name of the regionserverqueueId- a String that identifies the queue.fileName- name of the WAL- Throws:
ReplicationException
-
setWALPosition
public void setWALPosition(ServerName serverName, String queueId, String fileName, long position, Map<String, Long> lastSeqIds) throws ReplicationExceptionDescription copied from interface:ReplicationQueueStorageSet the current position for a specific WAL in a given queue for a given regionserver.- Specified by:
setWALPositionin interfaceReplicationQueueStorage- Parameters:
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.- Throws:
ReplicationException
-
getLastSequenceId
Description copied from interface:ReplicationQueueStorageRead the max sequence id of the specific region for a given peer. For serial replication, we need the max sequenced id to decide whether we can push the next entries.- Specified by:
getLastSequenceIdin interfaceReplicationQueueStorage- Parameters:
encodedRegionName- the encoded region namepeerId- peer id- Returns:
- the max sequence id of the specific region for a given peer.
- Throws:
ReplicationException
-
setLastSequenceIds
public void setLastSequenceIds(String peerId, Map<String, Long> lastSeqIds) throws ReplicationExceptionDescription copied from interface:ReplicationQueueStorageSet the max sequence id of a bunch of regions for a given peer. Will be called when setting up a serial replication peer.- Specified by:
setLastSequenceIdsin interfaceReplicationQueueStorage- Parameters:
peerId- peer idlastSeqIds- map with {encodedRegionName, sequenceId} pairs for serial replication.- Throws:
ReplicationException
-
removeLastSequenceIds
Description copied from interface:ReplicationQueueStorageRemove all the max sequence id record for the given peer.- Specified by:
removeLastSequenceIdsin interfaceReplicationQueueStorage- Parameters:
peerId- peer id- Throws:
ReplicationException
-
removeLastSequenceIds
public void removeLastSequenceIds(String peerId, List<String> encodedRegionNames) throws ReplicationException Description copied from interface:ReplicationQueueStorageRemove the max sequence id record for the given peer and regions.- Specified by:
removeLastSequenceIdsin interfaceReplicationQueueStorage- Parameters:
peerId- peer idencodedRegionNames- the encoded region names- Throws:
ReplicationException
-
getWALPosition
public long getWALPosition(ServerName serverName, String queueId, String fileName) throws ReplicationException Description copied from interface:ReplicationQueueStorageGet the current position for a specific WAL in a given queue for a given regionserver.- Specified by:
getWALPositionin interfaceReplicationQueueStorage- Parameters:
serverName- the name of the regionserverqueueId- a String that identifies the queuefileName- name of the WAL- Returns:
- the current position in the file
- Throws:
ReplicationException
-
getWALsInQueue
public List<String> getWALsInQueue(ServerName serverName, String queueId) throws ReplicationException Description copied from interface:ReplicationQueueStorageGet a list of all WALs in the given queue on the given region server.- Specified by:
getWALsInQueuein interfaceReplicationQueueStorage- Parameters:
serverName- the server name of the region server that owns the queuequeueId- a String that identifies the queue- Returns:
- a list of WALs
- Throws:
ReplicationException
-
getAllQueues
Description copied from interface:ReplicationQueueStorageGet a list of all queues for the specified region server.- Specified by:
getAllQueuesin interfaceReplicationQueueStorage- Parameters:
serverName- the server name of the region server that owns the set of queues- Returns:
- a list of queueIds
- Throws:
ReplicationException
-
claimQueue
public Pair<String,SortedSet<String>> claimQueue(ServerName sourceServerName, String queueId, ServerName destServerName) throws ReplicationException Description copied from interface:ReplicationQueueStorageChange ownership for the queue identified by queueId and belongs to a dead region server.- Specified by:
claimQueuein interfaceReplicationQueueStorage- Parameters:
sourceServerName- the name of the dead region serverqueueId- the id of the queuedestServerName- the name of the target region server- Returns:
- the new PeerId and A SortedSet of WALs in its queue
- Throws:
ReplicationException
-
removeReplicatorIfQueueIsEmpty
Description copied from interface:ReplicationQueueStorageRemove the record of region server if the queue is empty.- Specified by:
removeReplicatorIfQueueIsEmptyin interfaceReplicationQueueStorage- Throws:
ReplicationException
-
getListOfReplicators
Description copied from interface:ReplicationQueueStorageGet a list of all region servers that have outstanding replication queues. These servers could be alive, dead or from a previous run of the cluster.- Specified by:
getListOfReplicatorsin interfaceReplicationQueueStorage- Returns:
- a list of server names
- Throws:
ReplicationException
-
getAllWALs
Description copied from interface:ReplicationQueueStorageLoad all wals in all replication queues. This method guarantees to return a snapshot which contains all WALs at the start of this call even there is concurrent queue failover. However, some newly created WALs during the call may not be included.- Specified by:
getAllWALsin interfaceReplicationQueueStorage- Throws:
ReplicationException
-
addPeerToHFileRefs
Description copied from interface:ReplicationQueueStorageAdd a peer to hfile reference queue if peer does not exist.- Specified by:
addPeerToHFileRefsin interfaceReplicationQueueStorage- Parameters:
peerId- peer cluster id to be added- Throws:
ReplicationException- if fails to add a peer id to hfile reference queue
-
removePeerFromHFileRefs
Description copied from interface:ReplicationQueueStorageRemove a peer from hfile reference queue.- Specified by:
removePeerFromHFileRefsin interfaceReplicationQueueStorage- Parameters:
peerId- peer cluster id to be removed- Throws:
ReplicationException
-
addHFileRefs
public void addHFileRefs(String peerId, List<Pair<org.apache.hadoop.fs.Path, org.apache.hadoop.fs.Path>> pairs) throws ReplicationExceptionDescription copied from interface:ReplicationQueueStorageAdd new hfile references to the queue.- Specified by:
addHFileRefsin interfaceReplicationQueueStorage- Parameters:
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 }- Throws:
ReplicationException- if fails to add a hfile reference
-
removeHFileRefs
Description copied from interface:ReplicationQueueStorageRemove hfile references from the queue.- Specified by:
removeHFileRefsin interfaceReplicationQueueStorage- Parameters:
peerId- peer cluster id from which this hfile references needs to be removedfiles- list of hfile references to be removed- Throws:
ReplicationException
-
getAllPeersFromHFileRefsQueue
Description copied from interface:ReplicationQueueStorageGet list of all peers from hfile reference queue.- Specified by:
getAllPeersFromHFileRefsQueuein interfaceReplicationQueueStorage- Returns:
- a list of peer ids
- Throws:
ReplicationException
-
getReplicableHFiles
Description copied from interface:ReplicationQueueStorageGet a list of all hfile references in the given peer.- Specified by:
getReplicableHFilesin interfaceReplicationQueueStorage- Parameters:
peerId- a String that identifies the peer- Returns:
- a list of hfile references
- Throws:
ReplicationException
-
getAllHFileRefs
Description copied from interface:ReplicationQueueStorageLoad all hfile references in all replication queues. This method guarantees to return a snapshot which contains all hfile references at the start of this call. However, some newly created hfile references during the call may not be included.- Specified by:
getAllHFileRefsin interfaceReplicationQueueStorage- Throws:
ReplicationException
-
getRsNode
Description copied from interface:ReplicationQueueStorageGet full znode name for given region server- Specified by:
getRsNodein interfaceReplicationQueueStorage- Parameters:
serverName- the name of the region server- Returns:
- full znode name
-