Class WALEntryFilterBase
- All Implemented Interfaces:
WALEntryFilter
- Direct Known Subclasses:
ClusterMarkingEntryFilter
,ScopeWALEntryFilter
WALEntryFilter
, store the necessary common properties like
serial
.
Why need to treat serial replication specially:
Under some special cases, we may filter out some entries but we still need to record the last pushed sequence id for these entries. For example, when we setup a bidirection replication A <-> B, if we write to both cluster A and cluster B, cluster A will not replicate the entries which are replicated from cluster B, which means we may have holes in the replication sequence ids. So if the region is closed abnormally, i.e, we do not have a close event for the region, and before the closing, we have some entries from cluster B, then the replication from cluster A to cluster B will be stuck if we do not record the last pushed sequence id of these entries because we will find out that the previous sequence id range will never finish. So we need to record the sequence id for these entries so the last pushed sequence id can reach the region barrier.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final WAL.Entry
clearOrNull
(WAL.Entry entry) Call this method when you do not need to replicate the entry.void
setSerial
(boolean serial) Tell the filter whether the peer is a serial replication peer.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.WALEntryFilter
filter
-
Field Details
-
serial
-
-
Constructor Details
-
WALEntryFilterBase
public WALEntryFilterBase()
-
-
Method Details
-
setSerial
Description copied from interface:WALEntryFilter
Tell the filter whether the peer is a serial replication peer.For serial replication, usually you should not filter out an entire entry, unless the peer config does not contain the table, because we need the region name and sequence id of the entry to advance the pushed sequence id, otherwise the replication may be blocked. You can just filter out all the cells of the entry to stop it being replicated to peer cluster,or just rely on the
WALCellFilter.filterCell(Entry, org.apache.hadoop.hbase.Cell)
method to filter all the cells out.- Specified by:
setSerial
in interfaceWALEntryFilter
- Parameters:
serial
-true
if the peer is a serial replication peer, otherwisefalse
-
clearOrNull
Call this method when you do not need to replicate the entry.For serial replication, since still need to WALKey for recording progress, we clear all the cells of the WALEdit. For normal replication, we just return null.
-