stoty commented on code in PR #109:
URL: https://github.com/apache/phoenix-omid/pull/109#discussion_r951188975
##########
hbase-coprocessor/src/main/java/org/apache/omid/transaction/CellSkipFilterBase.java:
##########
@@ -19,58 +19,54 @@
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellUtil;
-import org.apache.hadoop.hbase.KeyValue;
-import org.apache.hadoop.hbase.KeyValueUtil;
+import org.apache.hadoop.hbase.PrivateCellUtil;
import org.apache.hadoop.hbase.filter.Filter;
import org.apache.hadoop.hbase.filter.FilterBase;
import java.io.IOException;
import java.util.List;
/**
- * {@link Filter} that encapsulates another {@link Filter}. It remembers the
last {@link KeyValue}
+ * {@link Filter} that encapsulates another {@link Filter}. It remembers the
last {@link Cell}
* for which the underlying filter returned the {@link ReturnCode#NEXT_COL} or
{@link ReturnCode#INCLUDE_AND_NEXT_COL},
- * so that when {@link #filterKeyValue} is called again for the same {@link
KeyValue} with different
+ * so that when {@link #filterCell} is called again for the same {@link Cell}
with different
* version, it returns {@link ReturnCode#NEXT_COL} directly without consulting
the underlying {@link Filter}.
* Please see TEPHRA-169 for more details.
*/
public class CellSkipFilterBase extends FilterBase {
private final Filter filter;
- // remember the previous keyvalue processed by filter when the return code
was NEXT_COL or INCLUDE_AND_NEXT_COL
- private KeyValue skipColumn = null;
+ // remember the previous cell processed by filter when the return code was
NEXT_COL or INCLUDE_AND_NEXT_COL
+ private Cell skipColumn = null;
public CellSkipFilterBase(Filter filter) {
this.filter = filter;
}
/**
* Determines whether the current cell should be skipped. The cell will be
skipped
- * if the previous keyvalue had the same key as the current cell. This
means filter already responded
- * for the previous keyvalue with ReturnCode.NEXT_COL or
ReturnCode.INCLUDE_AND_NEXT_COL.
+ * if the previous cell had the same key as the current cell. This means
filter already responded
+ * for the previous cell with ReturnCode.NEXT_COL or
ReturnCode.INCLUDE_AND_NEXT_COL.
* @param cell the {@link Cell} to be tested for skipping
* @return true is current cell should be skipped, false otherwise
*/
private boolean skipCellVersion(Cell cell) {
return skipColumn != null
- && CellUtil.matchingRow(cell, skipColumn.getRowArray(),
skipColumn.getRowOffset(),
- skipColumn.getRowLength())
- && CellUtil.matchingFamily(cell, skipColumn.getFamilyArray(),
skipColumn.getFamilyOffset(),
- skipColumn.getFamilyLength())
- && CellUtil.matchingQualifier(cell,
skipColumn.getQualifierArray(), skipColumn.getQualifierOffset(),
- skipColumn.getQualifierLength());
+ && CellUtil.matchingRows(cell, skipColumn)
+ && CellUtil.matchingFamily(cell, skipColumn)
+ && CellUtil.matchingQualifier(cell, skipColumn);
}
@Override
- public ReturnCode filterKeyValue(Cell cell) throws IOException {
+ public ReturnCode filterCell(Cell cell) throws IOException {
Review Comment:
Please add comments to the deprected methods explaining the above.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]