所有的過濾器都在服務端生效,叫做謂語下推(predicate push down),這樣可以保證被過濾掉的資料不會被傳送到用戶端。
注意:
基于字元串的比較器,如regexstringcomparator和substringcomparator,比基于位元組的比較器更慢,更消耗資源。因為每次比較時它們都需要将給定的值轉化為string.截取字元串子串和正則式的處理也需要花費額外的時間。
過濾器本來的目的是為了篩掉無用的資訊,所有基于comparefilter的過濾處理過程是傳回比對的值。
interface for row and column filters directly applied within the regionserver. a filter can expect the following call sequence:
filter instances are created one per region/scan. this abstract class replaces the old rowfilterinterface. when implementing your own filters, consider inheriting filterbase to help you reduce boilerplate.
過濾器執行個體在每次region/scan時被建立,并且使用抽象類代替了原來的接口。如果你需要實作自定義的過濾器,考慮直接繼承filterbase,來避免許多重複的結構代碼。