@InternalApi(value="For internal usage only") public class WhileMatchFilterAdapter extends TypedFilterAdapterBase<org.apache.hadoop.hbase.filter.WhileMatchFilter>
WhileMatchFilter
.
For internal use only - public for technical reasons.
Constructor and Description |
---|
WhileMatchFilterAdapter(FilterAdapter subFilterAdapter)
Constructor for WhileMatchFilterAdapter.
|
Modifier and Type | Method and Description |
---|---|
com.google.cloud.bigtable.data.v2.models.Filters.Filter |
adapt(FilterAdapterContext context,
org.apache.hadoop.hbase.filter.WhileMatchFilter filter)
Adapt the given filter.
|
FilterSupportStatus |
isFilterSupported(FilterAdapterContext context,
org.apache.hadoop.hbase.filter.WhileMatchFilter filter)
Determine if the given filter can be adapted to a Bigtable RowFilter.
|
getIndexScanHint
public WhileMatchFilterAdapter(FilterAdapter subFilterAdapter)
subFilterAdapter
- a FilterAdapter
object.public com.google.cloud.bigtable.data.v2.models.Filters.Filter adapt(FilterAdapterContext context, org.apache.hadoop.hbase.filter.WhileMatchFilter filter) throws IOException
Adapt WhileMatchFilter
as follow:
| V +--------+--------+ | | | | label('id-in') wrappedFilter.filter() | | | | sink() +-----+-----+ + | | label('id-out') all() | | sink() | + v
The above implementation gives enough information from the server side to determine whether
the remaining rows should be filtered out. For each WhileMatchFilter
instance, an
unique ID is generated for labeling. The input label is the unique ID suffixed by "-in" and the
output label is the unique ID suffixed by "-out". When wrappedFilter
decides to filter
out the rest of rows, there is no out label ("id-out") applied in the output. In other words,
when there is a missing "id-out" for an input "id-in", WhileMatchFilter.filterAllRemaining()
returns true
. Since the server continues to send
result even though WhileMatchFilter.filterAllRemaining()
returns true
, we need
to replace this WhileMatchFilter
instance with a "block all" filter and rescan from the
next row.
context
- a FilterAdapterContext
object.filter
- a S object.Filters.Filter
object.IOException
- if any.public FilterSupportStatus isFilterSupported(FilterAdapterContext context, org.apache.hadoop.hbase.filter.WhileMatchFilter filter)
context
- a FilterAdapterContext
object.filter
- a S object.FilterSupportStatus
object.