co.cask.tephra.hbase96.coprocessor
Class TransactionVisibilityFilter

java.lang.Object
  extended by org.apache.hadoop.hbase.filter.Filter
      extended by org.apache.hadoop.hbase.filter.FilterBase
          extended by co.cask.tephra.hbase96.coprocessor.TransactionVisibilityFilter

public class TransactionVisibilityFilter
extends org.apache.hadoop.hbase.filter.FilterBase

Applies filtering of data based on transactional visibility (HBase 0.96+ specific version). Note: this is intended for server-side use only, as additional properties need to be set on any Scan or Get operation performed.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.filter.Filter
org.apache.hadoop.hbase.filter.Filter.ReturnCode
 
Constructor Summary
TransactionVisibilityFilter(Transaction tx, Map<byte[],Long> ttlByFamily, boolean allowEmptyValues)
          Creates a new Filter for returning data only from visible transactions.
TransactionVisibilityFilter(Transaction tx, Map<byte[],Long> ttlByFamily, boolean allowEmptyValues, org.apache.hadoop.hbase.filter.Filter cellFilter)
          Creates a new Filter for returning data only from visible transactions.
 
Method Summary
 org.apache.hadoop.hbase.filter.Filter.ReturnCode filterKeyValue(org.apache.hadoop.hbase.Cell cell)
           
 byte[] toByteArray()
           
 
Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase
createFilterFromArguments, filterAllRemaining, filterRow, filterRow, filterRowCells, filterRowKey, getNextCellHint, getNextKeyHint, hasFilterRow, isFamilyEssential, reset, toString, transform, transformCell
 
Methods inherited from class org.apache.hadoop.hbase.filter.Filter
parseFrom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransactionVisibilityFilter

public TransactionVisibilityFilter(Transaction tx,
                                   Map<byte[],Long> ttlByFamily,
                                   boolean allowEmptyValues)
Creates a new Filter for returning data only from visible transactions.

Parameters:
tx - The current transaction to apply. Only data visible to this transaction will be returned.
ttlByFamily - Map of time-to-live (TTL) (in milliseconds) by column family name.
allowEmptyValues - If true cells with empty byte[] values will be returned, if false these will be interpreted as "delete" markers and the column will be filtered out.

TransactionVisibilityFilter

public TransactionVisibilityFilter(Transaction tx,
                                   Map<byte[],Long> ttlByFamily,
                                   boolean allowEmptyValues,
                                   @Nullable
                                   org.apache.hadoop.hbase.filter.Filter cellFilter)
Creates a new Filter for returning data only from visible transactions.

Parameters:
tx - The current transaction to apply. Only data visible to this transaction will be returned.
ttlByFamily - Map of time-to-live (TTL) (in milliseconds) by column family name.
allowEmptyValues - If true cells with empty byte[] values will be returned, if false these will be interpreted as "delete" markers and the column will be filtered out.
cellFilter - If non-null, this filter will be applied to all cells visible to the current transaction, by calling Filter.filterKeyValue(org.apache.hadoop.hbase.Cell). If null, then Filter.ReturnCode#INCLUDE_AND_NEXT_COL will be returned instead.
Method Detail

filterKeyValue

public org.apache.hadoop.hbase.filter.Filter.ReturnCode filterKeyValue(org.apache.hadoop.hbase.Cell cell)
                                                                throws IOException
Overrides:
filterKeyValue in class org.apache.hadoop.hbase.filter.FilterBase
Throws:
IOException

toByteArray

public byte[] toByteArray()
                   throws IOException
Overrides:
toByteArray in class org.apache.hadoop.hbase.filter.FilterBase
Throws:
IOException


Copyright © 2014. All Rights Reserved.