public class TransactionVisibilityFilter
extends org.apache.hadoop.hbase.filter.FilterBase
Scan
or Get
operation performed.Constructor and Description |
---|
TransactionVisibilityFilter(Transaction tx,
Map<byte[],Long> ttlByFamily,
boolean allowEmptyValues,
org.apache.hadoop.hbase.regionserver.ScanType scanType)
Creates a new
Filter for returning data only from visible transactions. |
TransactionVisibilityFilter(Transaction tx,
Map<byte[],Long> ttlByFamily,
boolean allowEmptyValues,
org.apache.hadoop.hbase.regionserver.ScanType scanType,
org.apache.hadoop.hbase.filter.Filter cellFilter)
Creates a new
Filter for returning data only from visible transactions. |
Modifier and Type | Method and Description |
---|---|
protected org.apache.hadoop.hbase.filter.Filter.ReturnCode |
determineReturnCode(org.apache.hadoop.hbase.filter.Filter.ReturnCode txFilterCode,
org.apache.hadoop.hbase.filter.Filter.ReturnCode subFilterCode)
Determines the return code of TransactionVisibilityFilter based on sub-filter's return code.
|
boolean |
filterAllRemaining() |
org.apache.hadoop.hbase.filter.Filter.ReturnCode |
filterKeyValue(org.apache.hadoop.hbase.Cell cell) |
boolean |
filterRow() |
void |
filterRowCells(List<org.apache.hadoop.hbase.Cell> kvs) |
boolean |
filterRowKey(byte[] buffer,
int offset,
int length) |
org.apache.hadoop.hbase.Cell |
getNextCellHint(org.apache.hadoop.hbase.Cell currentKV) |
org.apache.hadoop.hbase.KeyValue |
getNextKeyHint(org.apache.hadoop.hbase.KeyValue currentKV) |
boolean |
hasFilterRow() |
boolean |
isFamilyEssential(byte[] name) |
void |
reset() |
byte[] |
toByteArray() |
org.apache.hadoop.hbase.Cell |
transformCell(org.apache.hadoop.hbase.Cell cell) |
createFilterFromArguments, toString, transform
public TransactionVisibilityFilter(Transaction tx, Map<byte[],Long> ttlByFamily, boolean allowEmptyValues, org.apache.hadoop.hbase.regionserver.ScanType scanType)
Filter
for returning data only from visible transactions.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 nameallowEmptyValues
- 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 outscanType
- the type of scan operation being performedpublic TransactionVisibilityFilter(Transaction tx, Map<byte[],Long> ttlByFamily, boolean allowEmptyValues, org.apache.hadoop.hbase.regionserver.ScanType scanType, @Nullable org.apache.hadoop.hbase.filter.Filter cellFilter)
Filter
for returning data only from visible transactions.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 nameallowEmptyValues
- 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 outscanType
- the type of scan operation being performedcellFilter
- 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.public org.apache.hadoop.hbase.filter.Filter.ReturnCode filterKeyValue(org.apache.hadoop.hbase.Cell cell) throws IOException
filterKeyValue
in class org.apache.hadoop.hbase.filter.Filter
IOException
protected org.apache.hadoop.hbase.filter.Filter.ReturnCode determineReturnCode(org.apache.hadoop.hbase.filter.Filter.ReturnCode txFilterCode, org.apache.hadoop.hbase.filter.Filter.ReturnCode subFilterCode)
txFilterCode
- return code from TransactionVisibilityFiltersubFilterCode
- return code from sub-filterpublic boolean filterRow() throws IOException
filterRow
in class org.apache.hadoop.hbase.filter.FilterBase
IOException
public org.apache.hadoop.hbase.Cell transformCell(org.apache.hadoop.hbase.Cell cell) throws IOException
transformCell
in class org.apache.hadoop.hbase.filter.FilterBase
IOException
public void reset() throws IOException
reset
in class org.apache.hadoop.hbase.filter.FilterBase
IOException
public boolean filterRowKey(byte[] buffer, int offset, int length) throws IOException
filterRowKey
in class org.apache.hadoop.hbase.filter.FilterBase
IOException
public boolean filterAllRemaining() throws IOException
filterAllRemaining
in class org.apache.hadoop.hbase.filter.FilterBase
IOException
public void filterRowCells(List<org.apache.hadoop.hbase.Cell> kvs) throws IOException
filterRowCells
in class org.apache.hadoop.hbase.filter.FilterBase
IOException
public boolean hasFilterRow()
hasFilterRow
in class org.apache.hadoop.hbase.filter.FilterBase
public org.apache.hadoop.hbase.KeyValue getNextKeyHint(org.apache.hadoop.hbase.KeyValue currentKV) throws IOException
getNextKeyHint
in class org.apache.hadoop.hbase.filter.FilterBase
IOException
public org.apache.hadoop.hbase.Cell getNextCellHint(org.apache.hadoop.hbase.Cell currentKV) throws IOException
getNextCellHint
in class org.apache.hadoop.hbase.filter.FilterBase
IOException
public boolean isFamilyEssential(byte[] name) throws IOException
isFamilyEssential
in class org.apache.hadoop.hbase.filter.FilterBase
IOException
public byte[] toByteArray() throws IOException
toByteArray
in class org.apache.hadoop.hbase.filter.FilterBase
IOException
Copyright © 2016 The Apache Software Foundation. All rights reserved.