- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3.4k
HBASE-24817 Allow configuring WALEntry filters on ReplicationSource #2198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| 💔 -1 overall 
 This message was automatically generated. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few minor nits, +1 otherwise
| * the entry to be skipped for replication. | ||
| */ | ||
| public Entry filter(Entry entry); | ||
| Entry filter(Entry entry); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For system tables we return null Entry. Good to consider return type Optional<Entry> here?
Maybe as follow up task?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how it works now.... no Optional. Will leave it in this patch. Thanks.
| // Test non-system WAL edit. | ||
| WAL.Entry e = new WAL.Entry(new WALKeyImpl(HConstants.EMPTY_BYTE_ARRAY, | ||
| TableName.valueOf("test"), -1), new WALEdit()); | ||
| assertTrue(wef.filter(e) == e); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: just in case if you like assertSame(e, wef.filter(e))
|  | ||
| @Override public void init(Context context) throws IOException { | ||
| this.ctx = context; | ||
| return; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Fixed. Thanks.
| if (queueSize > this.logQueueWarnThreshold) { | ||
| LOG.warn("{} WAL group {} queue size: {} exceeds value of " | ||
| + "replication.source.log.queue.warn: {}", logPeerId(), | ||
| + "replication.source.wal.queue.warn: {}", logPeerId(), | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we changing this config name also in this patch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Thanks. Let me restore.
Allow specifying base WALEntry filter on construction of ReplicationSource. Add means of being able to filter WALs by name. hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java Add constructor that allows passing a predicate for filtering *in* WALs and a list of filters for filtering *out* WALEntries. The latter was hardcoded to filter out system-table WALEntries. The former did not exist but we'll need it if Replication takes in more than just the default Provider.
| The failures seem unrelated (too many and the few I checked pass locally) | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
…2198) Allow specifying base WALEntry filter on construction of ReplicationSource. Add means of being able to filter WALs by name. hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java Add constructor that allows passing a predicate for filtering *in* WALs and a list of filters for filtering *out* WALEntries. The latter was hardcoded to filter out system-table WALEntries. The former did not exist but we'll need it if Replication takes in more than just the default Provider. Signed-off-by Anoop Sam John <[email protected]> Signed-off-by: Viraj Jasani <[email protected]>
…pache#2198) Allow specifying base WALEntry filter on construction of ReplicationSource. Add means of being able to filter WALs by name. hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java Add constructor that allows passing a predicate for filtering *in* WALs and a list of filters for filtering *out* WALEntries. The latter was hardcoded to filter out system-table WALEntries. The former did not exist but we'll need it if Replication takes in more than just the default Provider. Signed-off-by Anoop Sam John <[email protected]> Signed-off-by: Viraj Jasani <[email protected]>
Allow specifying base WALEntry filter on construction of
ReplicationSource. Add means of being able to filter WALs by name.
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
Add constructor that allows passing a predicate for filtering in WALs
and a list of filters for filtering out WALEntries. The latter was
hardcoded to filter out system-table WALEntries. The former did not
exist but we'll need it if Replication takes in more than just the
default Provider.