[ 
https://issues.apache.org/jira/browse/OMID-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17581711#comment-17581711
 ] 

ASF GitHub Bot commented on OMID-223:
-------------------------------------

stoty commented on code in PR #109:
URL: https://github.com/apache/phoenix-omid/pull/109#discussion_r949831949


##########
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:
   We have talked about what to do bout these functions extensively, and at the 
time I suggested that you simply rename the filterKeyValue() and 
filterRowKey(byte[] buffer, int offset, int length).
   
   On second thought, the old methods are still part of the HBase 2 API, and  
we should not implement an incomplete API just because the methods are 
deprecated.
   
   We should implement both the current and deprecated versions, that will also 
make updating to 1.1.0 in Phoenix easier, and we can swicth to the new API in 
Phoenix later.





> Refactor Omid to use HBase 2 APIs internally.
> ---------------------------------------------
>
>                 Key: OMID-223
>                 URL: https://issues.apache.org/jira/browse/OMID-223
>             Project: Phoenix Omid
>          Issue Type: Improvement
>            Reporter: Istvan Toth
>            Assignee: Aron Attila Meszaros
>            Priority: Major
>         Attachments: OMID-223-wip.patch
>
>
> Omid currently uses HBase 1 APIs everywhere. 
> This made sense when HBase 1 and 2 had to be supported from the same codebase.
> However, as we're dropping HBase 1 support, this is a liability now.
> Doing this is also going to eventually make supporting HBase 3 much easier.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to