Class ChainWALEntryFilter
- All Implemented Interfaces:
WALEntryFilter
- Direct Known Subclasses:
ChainWALEmptyEntryFilter
WALEntryFilter
which contains multiple filters and applies them in chain order-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionChainWALEntryFilter
(List<WALEntryFilter> filters) ChainWALEntryFilter
(WALEntryFilter... filters) -
Method Summary
Modifier and TypeMethodDescriptionApplies the filter, possibly returning a different Entry instance.private Cell
filterCell
(WAL.Entry entry, Cell cell) protected void
filterCells
(WAL.Entry entry) protected WAL.Entry
filterEntry
(WAL.Entry entry) void
void
setSerial
(boolean serial) Tell the filter whether the peer is a serial replication peer.
-
Field Details
-
filters
-
cellFilters
-
-
Constructor Details
-
ChainWALEntryFilter
-
ChainWALEntryFilter
-
-
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
-
initCellFilters
-
filter
Description copied from interface:WALEntryFilter
Applies the filter, possibly returning a different Entry instance. If null is returned, the entry will be skipped.
Notice that you are free to modify the cell list of the give entry, but do not change the content of the cell, it may be used by others at the same time(and usually you can not modify a cell unless you cast it to the implementation class, which is not a good idea).
- Specified by:
filter
in interfaceWALEntryFilter
- Parameters:
entry
- Entry to filter- Returns:
- a (possibly modified) Entry to use. Returning null or an entry with no cells will cause the entry to be skipped for replication.
-
filterEntry
-
filterCells
-
filterCell
-