Package org.apache.hadoop.hbase.filter
Class DependentColumnFilter
java.lang.Object
org.apache.hadoop.hbase.filter.Filter
org.apache.hadoop.hbase.filter.FilterBase
org.apache.hadoop.hbase.filter.CompareFilter
org.apache.hadoop.hbase.filter.DependentColumnFilter
A filter for adding inter-column timestamp matching Only cells with a correspondingly timestamped
entry in the target column will be retained Not compatible with Scan.setBatch as operations need
full rows for correct filtering
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.filter.Filter
Filter.ReturnCode -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]protected byte[]protected booleanFields inherited from class org.apache.hadoop.hbase.filter.CompareFilter
comparator, op -
Constructor Summary
ConstructorsConstructorDescriptionDependentColumnFilter(byte[] family, byte[] qualifier) Constructor for DependentColumn filter.DependentColumnFilter(byte[] family, byte[] qualifier, boolean dropDependentColumn) Constructor for DependentColumn filter.DependentColumnFilter(byte[] family, byte[] qualifier, boolean dropDependentColumn, CompareOperator op, ByteArrayComparable valueComparator) Build a dependent column filter with value checking dependent column varies will be compared using the supplied compareOp and comparator, for usage of which refer toCompareFilter -
Method Summary
Modifier and TypeMethodDescription(package private) booleanReturns true if and only if the fields of the filter that are serialized are equal to the corresponding fields in other.static FiltercreateFilterFromArguments(ArrayList<byte[]> filterArguments) booleanReturns true if we should drop the dependent column, false otherwisebooleanbooleanFilters that never filter all remaining can inherit this implementation that never stops the filter early.filterCell(Cell c) A way to filter based on the column family, column qualifier and/or the column value.booleanFilters that never filter by rows based on previously gathered state fromFilter.filterCell(Cell)can inherit this implementation that never filters a row.voidfilterRowCells(List<Cell> kvs) Filters that never filter by modifying the returned List of Cells can inherit this implementation that does nothing.booleanbyte[]Returns the column familybyte[]Returns the column qualifierbooleanFilters that never filter by modifying the returned List of Cells can inherit this implementation that does nothing.inthashCode()static DependentColumnFilterparseFrom(byte[] pbBytes) Parse a seralized representation ofDependentColumnFiltervoidreset()Filters that are purely stateless and do nothing in their reset() methods can inherit this null/empty implementation.byte[]Returns The filter serialized using pbtoString()Return filter's info for debugging and logging purpose.Methods inherited from class org.apache.hadoop.hbase.filter.CompareFilter
compare, compareFamily, compareQualifier, compareRow, compareValue, convert, extractArguments, filterRowKey, getComparator, getCompareOperatorMethods inherited from class org.apache.hadoop.hbase.filter.FilterBase
getNextCellHint, isFamilyEssential, transformCellMethods inherited from class org.apache.hadoop.hbase.filter.Filter
isReversed, setReversed
-
Field Details
-
columnFamily
-
columnQualifier
-
dropDependentColumn
-
stampSet
-
-
Constructor Details
-
DependentColumnFilter
public DependentColumnFilter(byte[] family, byte[] qualifier, boolean dropDependentColumn, CompareOperator op, ByteArrayComparable valueComparator) Build a dependent column filter with value checking dependent column varies will be compared using the supplied compareOp and comparator, for usage of which refer toCompareFilter- Parameters:
family- dependent column familyqualifier- dependent column qualifierdropDependentColumn- whether the column should be discarded afterop- Value comparison opvalueComparator- comparator
-
DependentColumnFilter
Constructor for DependentColumn filter. Cells where a Cell from target column with the same timestamp do not exist will be dropped.- Parameters:
family- name of target column familyqualifier- name of column qualifier
-
DependentColumnFilter
Constructor for DependentColumn filter. Cells where a Cell from target column with the same timestamp do not exist will be dropped.- Parameters:
family- name of dependent column familyqualifier- name of dependent qualifierdropDependentColumn- whether the dependent columns Cells should be discarded
-
-
Method Details
-
getFamily
Returns the column family -
getQualifier
Returns the column qualifier -
dropDependentColumn
Returns true if we should drop the dependent column, false otherwise -
getDropDependentColumn
-
filterAllRemaining
Description copied from class:FilterBaseFilters that never filter all remaining can inherit this implementation that never stops the filter early. If this returns true, the scan will terminate. Concrete implementers can signal a failure condition in their code by throwing anIOException.- Overrides:
filterAllRemainingin classFilterBase- Returns:
- true to end scan, false to continue.
-
filterCell
Description copied from class:FilterA way to filter based on the column family, column qualifier and/or the column value. Return code is described below. This allows filters to filter only certain number of columns, then terminate without matching ever column. If filterRowKey returns true, filterCell needs to be consistent with it. filterCell can assume that filterRowKey has already been called for the row. If your filter returnsReturnCode.NEXT_ROW, it should returnReturnCode.NEXT_ROWuntilFilter.reset()is called just in case the caller calls for the next row. Concrete implementers can signal a failure condition in their code by throwing anIOException.- Overrides:
filterCellin classFilter- Parameters:
c- the Cell in question- Returns:
- code as described below
- See Also:
-
filterRowCells
Description copied from class:FilterBaseFilters that never filter by modifying the returned List of Cells can inherit this implementation that does nothing. Chance to alter the list of Cells to be submitted. Modifications to the list will carry on Concrete implementers can signal a failure condition in their code by throwing anIOException.- Overrides:
filterRowCellsin classFilterBase- Parameters:
kvs- the list of Cells to be filtered
-
hasFilterRow
Description copied from class:FilterBaseFilters that never filter by modifying the returned List of Cells can inherit this implementation that does nothing. Primarily used to check for conflicts with scans(such as scans that do not read a full row at a time).- Overrides:
hasFilterRowin classFilterBase- Returns:
- True if this filter actively uses filterRowCells(List) or filterRow().
-
filterRow
Description copied from class:FilterBaseFilters that never filter by rows based on previously gathered state fromFilter.filterCell(Cell)can inherit this implementation that never filters a row. Last chance to veto row based on previousFilter.filterCell(Cell)calls. The filter needs to retain state then return a particular value for this call if they wish to exclude a row if a certain column is missing (for example). Concrete implementers can signal a failure condition in their code by throwing anIOException.- Overrides:
filterRowin classFilterBase- Returns:
- true to exclude row, false to include row.
-
reset
Description copied from class:FilterBaseFilters that are purely stateless and do nothing in their reset() methods can inherit this null/empty implementation. Reset the state of the filter between rows. Concrete implementers can signal a failure condition in their code by throwing anIOException.- Overrides:
resetin classFilterBase
-
createFilterFromArguments
-
toByteArray
Returns The filter serialized using pb- Overrides:
toByteArrayin classFilterBase- Returns:
- The filter serialized using pb
-
parseFrom
Parse a seralized representation ofDependentColumnFilter- Parameters:
pbBytes- A pb serializedDependentColumnFilterinstance- Returns:
- An instance of
DependentColumnFiltermade frombytes - Throws:
DeserializationException- if an error occurred- See Also:
-
areSerializedFieldsEqual
Returns true if and only if the fields of the filter that are serialized are equal to the corresponding fields in other. Used for testing.- Overrides:
areSerializedFieldsEqualin classCompareFilter- Returns:
- true if and only if the fields of the filter that are serialized are equal to the corresponding fields in other. Used for testing.
-
toString
Description copied from class:FilterBaseReturn filter's info for debugging and logging purpose.- Overrides:
toStringin classCompareFilter
-
equals
- Overrides:
equalsin classCompareFilter
-
hashCode
- Overrides:
hashCodein classCompareFilter
-