[
https://issues.apache.org/jira/browse/HBASE-14766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14991055#comment-14991055
]
Ted Yu commented on HBASE-14766:
--------------------------------
{code}
patching file
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ScopeWALEntryFilter.java
Hunk #1 FAILED at 44.
1 out of 1 hunk FAILED -- saving rejects to file
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ScopeWALEntryFilter.java.rej
patching file
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/TableCfWALEntryFilter.java
Hunk #1 FAILED at 62.
1 out of 1 hunk FAILED -- saving rejects to file
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/TableCfWALEntryFilter.java.rej
{code}
Here is the content of the .rej file:
{code}
***************
*** 44,51 ****
Cell cell = cells.get(i);
// The scope will be null or empty if
// there's nothing to replicate in that WALEdit
- if (!scopes.containsKey(cell.getFamily())
- || scopes.get(cell.getFamily()) ==
HConstants.REPLICATION_SCOPE_LOCAL) {
cells.remove(i);
}
}
--- 44,52 ----
Cell cell = cells.get(i);
// The scope will be null or empty if
// there's nothing to replicate in that WALEdit
+ byte[] cf = cell.getFamily();
+ if (!scopes.containsKey(cf)
+ || scopes.get(cf) == HConstants.REPLICATION_SCOPE_LOCAL) {
cells.remove(i);
}
}
{code}
Please generate patch based on latest master branch
> WALEntryFilter's filter implement, cell.getFamily() needs to be replaced with
> the new low-cost implementation.
> --------------------------------------------------------------------------------------------------------------
>
> Key: HBASE-14766
> URL: https://issues.apache.org/jira/browse/HBASE-14766
> Project: HBase
> Issue Type: Improvement
> Reporter: huaxiang sun
> Assignee: huaxiang sun
> Attachments: HBASE-14766-v001.patch
>
>
> Cell's getFamily() gets an array copy of the cell's family, while in the
> filter function, it just needs to peek into the family and do a compare.
> Replace
> Bytes.toString(cell.getFamily())
> with
> Bytes.toString(cell.getFamilyArray(), cell.getFamilyOffset(),
> cell.getFamilyLength())
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)