hadoop,hbase常用API
public void setMaxVersions(int?maxVersions)指定数据最大保存的版本个数。默认为3。?2.org.apache.hadoop.hbase.filter?Class FilterList?
Implementation of?Filter
?that represents(代表) an ordered List of Filters which will be evaluated(评估) with a specified boolean operatorFilterList.Operator.MUST_PASS_ALL
?(!AND
) or?FilterList.Operator.MUST_PASS_ONE
?(!OR
). Since you can use Filter Lists as children of Filter Lists, you can create a hierarchy(等级) of filters to be evaluated. Defaults to?FilterList.Operator.MUST_PASS_ALL
.
TODO: Fix creation of Configuration on serialization and deserialization.
This filter is used to filter cells based on value. It takes a?CompareFilter.CompareOp
?operator (equal, greater, not equal, etc), and either a byte [] value or a WritableByteArrayComparable.
If we have a byte [] value then we just do a lexicographic(字典式的) compare. For example, if passed value is 'b' and cell has 'a' and the compare operator is LESS, then we will filter out this cell (return true). If this is not sufficient(足够的,充分的)(eg you want to deserialize a long and then compare it to a fixed long value), then you can pass in your own comparator instead.
You must also specify a family and qualifier. Only the value of this column will be tested. When using this filter on a?Scan
?with specified inputs, the column to be tested should also be added as input (otherwise the filter will regard the column as missing).
To prevent the entire row from being emitted if the column is not found on a row, use?setFilterIfMissing(boolean)
. Otherwise, if the column is found, the entire row will be emitted only if the value passes. If the value fails, the row will be filtered out.
In order to test values of previous versions (timestamps), set?setLatestVersionOnly(boolean)
?to false. The default is true, meaning that only the latest version's value is tested and all previous versions are ignored.
To filter based on the value of all scanned columns, use?ValueFilter
.
Filter
?that checks a single column value, but does not emit(发送) the tested column. This will enable a performance boost over?SingleColumnValueFilter
, if the tested column value is not actually needed as input (besides for the filtering itself).