Class TestVisibilityScanDeleteTracker

java.lang.Object
org.apache.hadoop.hbase.security.visibility.TestVisibilityScanDeleteTracker

@Tag("org.apache.hadoop.hbase.testclassification.SecurityTests") @Tag("org.apache.hadoop.hbase.testclassification.SmallTests") public class TestVisibilityScanDeleteTracker extends Object
Tests that VisibilityScanDeleteTracker never reports a delete marker as redundant.

HBASE-30036 added DeleteTracker.isRedundantDelete(ExtendedCell) so that minor compaction can drop a delete marker already covered by a previously tracked delete of equal or broader scope. The base ScanDeleteTracker implements it purely from delete type / timestamp / qualifier, with no regard to visibility labels.

On cell-visibility tables a delete marker only shadows cells whose visibility expression matches (see VisibilityScanDeleteTracker.isDeleted(org.apache.hadoop.hbase.ExtendedCell)). Two markers carrying different labels cover disjoint cells, so neither is redundant w.r.t. the other. Reusing the label-blind base logic would wrongly declare such a marker redundant; minor compaction would then drop it and resurrect cells that must stay deleted. VisibilityScanDeleteTracker must therefore conservatively report no delete as redundant.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final byte[]
     
    private static final byte[]
     
    private static final byte[]
     
    private static final byte[]
     
    private static final byte[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static org.apache.hadoop.hbase.ExtendedCell
    deleteMarker(byte[] qualifier, long ts, org.apache.hadoop.hbase.KeyValue.Type type, byte[] label)
     
    void
    A column-level delete must not be considered redundant just because a same-qualifier DeleteColumn with a higher timestamp was already tracked: if they carry different labels they shadow disjoint cells.
    void
    A family-level delete must not be considered redundant just because a DeleteFamily with a higher timestamp set the family stamp: a label-less family delete only shadows label-less cells, while a labeled one shadows that label's cells.
    void
    Even where the base answer would actually be correct (a label-less DeleteColumn covered by a label-less one of higher timestamp), the tracker still reports no redundancy, keeping the contract uniform across labeled and label-less markers.
    void
    Even a same-label marker is kept: the base coveredByColumn branch would (safely) treat a same-qualifier, same-label DeleteColumn of lower timestamp as redundant, but the visibility tracker forgoes that optimization so the label-blind base logic can never run.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ROW

      private static final byte[] ROW
    • FAMILY

      private static final byte[] FAMILY
    • QUALIFIER

      private static final byte[] QUALIFIER
    • LABEL_A

      private static final byte[] LABEL_A
    • LABEL_B

      private static final byte[] LABEL_B
  • Constructor Details

  • Method Details

    • differentLabelColumnDeleteIsNotRedundant

      A column-level delete must not be considered redundant just because a same-qualifier DeleteColumn with a higher timestamp was already tracked: if they carry different labels they shadow disjoint cells. The base tracker's coveredByColumn branch would return true.
    • differentLabelFamilyDeleteIsNotRedundant

      A family-level delete must not be considered redundant just because a DeleteFamily with a higher timestamp set the family stamp: a label-less family delete only shadows label-less cells, while a labeled one shadows that label's cells. The base tracker's coveredByFamily branch would return true.
    • sameLabelColumnDeleteIsNotRedundant

      Even a same-label marker is kept: the base coveredByColumn branch would (safely) treat a same-qualifier, same-label DeleteColumn of lower timestamp as redundant, but the visibility tracker forgoes that optimization so the label-blind base logic can never run. This pins the deliberately conservative contract against a future change that re-enables it.
    • labelLessColumnDeleteIsNotRedundant

      Even where the base answer would actually be correct (a label-less DeleteColumn covered by a label-less one of higher timestamp), the tracker still reports no redundancy, keeping the contract uniform across labeled and label-less markers.
    • deleteMarker

      private static org.apache.hadoop.hbase.ExtendedCell deleteMarker(byte[] qualifier, long ts, org.apache.hadoop.hbase.KeyValue.Type type, byte[] label)