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

Ted Yu commented on HBASE-10885:
--------------------------------

{code}
+   * Add the specified KeyValue to this Delete operation.  Operation assumes 
that
+   * the passed Cell is immutable and its backing array will not be modified
{code}
KeyValue appears in first line and Cell in second. Better make the terms 
consistent.
{code}
+    if (!KeyValue.isDelete(kv.getTypeByte())) {
+      throw new WrongRowIOException("The cell " + kv.toString() + "is not of 
Delete type");
{code}
Would IllegalArgumentException be more appropriate above ?
{code}
+  public static boolean isDeleteColumn(final Cell cell) {
+    return cell.getTypeByte() == Type.Delete.getCode();
+  }
{code}
In KeyValue, the above comparison is in a method called isDeleteType().

In VisibilityController#preDelete():
{code}
+    for (Map.Entry<byte[], List<Cell>> e : 
delete.getFamilyCellMap().entrySet()) {
+      byte[] family = e.getKey();
+      List<Cell> cells = e.getValue();
+      Map<byte[], Integer> kvCount = new TreeMap<byte[], 
Integer>(Bytes.BYTES_COMPARATOR);
{code}
The tree map can be reused across iterations, right ?
{code}
+      if (!matchFound && isDeleteLatest) {
+/*        throw new RuntimeException("No matching cell with given visibility 
expression found "
+            + delete);*/
{code}
What's your plan for the above comment ?
{code}
+public class VisibilityScanDeleteTracker extends ScanDeleteTracker {
{code}
Add annotation for audience.

Putting patch on review board would be nice.

> Support visibility expressions on Deletes
> -----------------------------------------
>
>                 Key: HBASE-10885
>                 URL: https://issues.apache.org/jira/browse/HBASE-10885
>             Project: HBase
>          Issue Type: Improvement
>    Affects Versions: 0.98.1
>            Reporter: Andrew Purtell
>            Assignee: ramkrishna.s.vasudevan
>            Priority: Critical
>             Fix For: 0.99.0, 0.98.2
>
>         Attachments: HBASE-10885_1.patch, HBASE-10885_2.patch
>
>
> Accumulo can specify visibility expressions for delete markers. During 
> compaction the cells covered by the tombstone are determined in part by 
> matching the visibility expression. This is useful for the use case of data 
> set coalescing, where entries from multiple data sets carrying different 
> labels are combined into one common large table. Later, a subset of entries 
> can be conveniently removed using visibility expressions.
> Currently doing the same in HBase would only be possible with a custom 
> coprocessor. Otherwise, a Delete will affect all cells covered by the 
> tombstone regardless of any visibility expression scoping. This is correct 
> behavior in that no data spill is possible, but certainly could be 
> surprising, and is only meant to be transitional. We decided not to support 
> visibility expressions on Deletes to control the complexity of the initial 
> implementation.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to