com.google.cloud.bigtable.hbase.adapters.filters
Class FilterAdapter
- java.lang.Object
-
- com.google.cloud.bigtable.hbase.adapters.filters.FilterAdapter
-
public class FilterAdapter extends Object
An adapter for converting an HBase Filter into Bigtable RowFilter objects- Version:
- $Id: $Id
- Author:
- sduskis
-
-
Constructor Summary
Constructors Modifier Constructor and Description protected
FilterAdapter()
Building the adapter map properly requires using a reference to the main FilterAdapter (to pass to FilterListAdapter).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description Optional<com.google.cloud.bigtable.data.v2.models.Filters.Filter>
adaptFilter(FilterAdapterContext context, Filter filter)
Adapt an HBase filter into a Cloud Bigtable Rowfilter.static FilterAdapter
buildAdapter()
Create a new FilterAdaptervoid
collectUnsupportedStatuses(FilterAdapterContext context, Filter filter, List<FilterSupportStatus> statuses)
Recursively collect all unsupported filters contained in Filter (which may be a FilterList)protected SingleFilterAdapter<?>
getAdapterForFilterOrThrow(Filter filter)
Get the adapter for the given Filter or throw an UnsupportedFilterException if one is not available.RangeSet<RowKeyWrapper>
getIndexScanHint(Filter filter)
void
throwIfUnsupportedFilter(Scan scan, Filter filter)
Throw a new UnsupportedFilterException if the given filter cannot be adapted to bigtable reader expressions.
-
-
-
Constructor Detail
-
FilterAdapter
protected FilterAdapter()
Building the adapter map properly requires using a reference to the main FilterAdapter (to pass to FilterListAdapter). As a result, a full adapter should be acquired via #buildAdapter().
-
-
Method Detail
-
buildAdapter
public static FilterAdapter buildAdapter()
Create a new FilterAdapter- Returns:
- a
FilterAdapter
object.
-
adaptFilter
public Optional<com.google.cloud.bigtable.data.v2.models.Filters.Filter> adaptFilter(FilterAdapterContext context, Filter filter) throws IOException
Adapt an HBase filter into a Cloud Bigtable Rowfilter.- Parameters:
context
- aFilterAdapterContext
object.filter
- aFilter
object.- Returns:
- a
Optional
object. - Throws:
IOException
- if any.
-
throwIfUnsupportedFilter
public void throwIfUnsupportedFilter(Scan scan, Filter filter)
Throw a new UnsupportedFilterException if the given filter cannot be adapted to bigtable reader expressions.
-
collectUnsupportedStatuses
public void collectUnsupportedStatuses(FilterAdapterContext context, Filter filter, List<FilterSupportStatus> statuses)
Recursively collect all unsupported filters contained in Filter (which may be a FilterList)- Parameters:
filter
- The filter to inspectstatuses
- A mutable list of status into which we will add any that indicate an unsupported Filter was found.context
- aFilterAdapterContext
object.
-
getIndexScanHint
public RangeSet<RowKeyWrapper> getIndexScanHint(Filter filter)
-
getAdapterForFilterOrThrow
protected SingleFilterAdapter<?> getAdapterForFilterOrThrow(Filter filter)
Get the adapter for the given Filter or throw an UnsupportedFilterException if one is not available.- Parameters:
filter
- aFilter
object.- Returns:
- a
SingleFilterAdapter
object.
-
-