com.google.cloud.bigtable.hbase.adapters.filters
Class FilterListAdapter
- java.lang.Object
-
- com.google.cloud.bigtable.hbase.adapters.filters.TypedFilterAdapterBase<FilterList>
-
- com.google.cloud.bigtable.hbase.adapters.filters.FilterListAdapter
-
- All Implemented Interfaces:
- TypedFilterAdapter<FilterList>, UnsupportedStatusCollector<FilterList>
public class FilterListAdapter extends TypedFilterAdapterBase<FilterList> implements UnsupportedStatusCollector<FilterList>
Adapts a FilterList into either a RowFilter with chaining or interleaving.- Version:
- $Id: $Id
- Author:
- sduskis
-
-
Constructor Summary
Constructors Constructor and Description FilterListAdapter(FilterAdapter subFilterAdapter)
Constructor for FilterListAdapter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description com.google.cloud.bigtable.data.v2.models.Filters.Filter
adapt(FilterAdapterContext context, FilterList filter)
Adapt the given filter.void
collectUnsupportedStatuses(FilterAdapterContext context, FilterList filter, List<FilterSupportStatus> unsupportedStatuses)
Collect FilterSupportStatuses from the filter Filter and all subfilters.RangeSet<RowKeyWrapper>
getIndexScanHint(FilterList filter)
Get hints how to optimize the scan.FilterSupportStatus
isFilterSupported(FilterAdapterContext context, FilterList filter)
Determine if the given filter can be adapted to a Bigtable RowFilter.
-
-
-
Constructor Detail
-
FilterListAdapter
public FilterListAdapter(FilterAdapter subFilterAdapter)
Constructor for FilterListAdapter.- Parameters:
subFilterAdapter
- aFilterAdapter
object.
-
-
Method Detail
-
adapt
public com.google.cloud.bigtable.data.v2.models.Filters.Filter adapt(FilterAdapterContext context, FilterList filter) throws IOException
Adapt the given filter. Implementers of this method should assume that isFilterSupported has already been called with a result indicating it is in fact supproted.- Specified by:
adapt
in interfaceTypedFilterAdapter<FilterList>
- Parameters:
context
- aFilterAdapterContext
object.filter
- a S object.- Returns:
- a
Filters.Filter
object. - Throws:
IOException
- if any.
-
isFilterSupported
public FilterSupportStatus isFilterSupported(FilterAdapterContext context, FilterList filter)
Determine if the given filter can be adapted to a Bigtable RowFilter.- Specified by:
isFilterSupported
in interfaceTypedFilterAdapter<FilterList>
- Parameters:
context
- aFilterAdapterContext
object.filter
- a S object.- Returns:
- a
FilterSupportStatus
object.
-
collectUnsupportedStatuses
public void collectUnsupportedStatuses(FilterAdapterContext context, FilterList filter, List<FilterSupportStatus> unsupportedStatuses)
Collect FilterSupportStatuses from the filter Filter and all subfilters.- Specified by:
collectUnsupportedStatuses
in interfaceUnsupportedStatusCollector<FilterList>
- Parameters:
context
- aFilterAdapterContext
object.filter
- a S object.unsupportedStatuses
- aList
object.
-
getIndexScanHint
public RangeSet<RowKeyWrapper> getIndexScanHint(FilterList filter)
Description copied from interface:TypedFilterAdapter
Get hints how to optimize the scan. For example if the filter will narrow the scan using the prefix "ab" then we can restrict the scan to ["ab" - "ac"). If the filter doesn't narrow the scan then it should return Range.all()- Specified by:
getIndexScanHint
in interfaceTypedFilterAdapter<FilterList>
- Overrides:
getIndexScanHint
in classTypedFilterAdapterBase<FilterList>
- Parameters:
filter
- aS
object.- Returns:
- a
RangeSet
object.
-
-