Class Filters
Intended usage is to statically import, or in case of conflict, assign the static variable FILTERS and use its fluent API to build filters.
Sample code:
import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS;
void main() {
// Build the filter expression
RowFilter filter = FILTERS.chain()
.filter(FILTERS.qualifier().regex("prefix.*"))
.filter(FILTERS.limit().cellsPerRow(10));
// Use it in a Query
Query query = Query.create("[TABLE]")
.filter(filter);
}
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
DSL for adding filters to a chain.static final class
DSL for configuring a conditional filter.static final class
static interface
static final class
DSL for adding filters to the interleave list.static final class
static final class
static final class
static final class
static final class
Matches only cells from columns within the given range.static final class
static final class
Matches only cells with microsecond timestamps within the given range.static final class
static final class
Matches only cells with values that fall within the given value range. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionblock()
Does not match any cells, regardless of input.chain()
Creates an empty chain filter list.condition
(Filters.Filter predicate) Creates an empty condition filter.family()
Returns the builder for column family related filters.Wraps protobuf representation of a filter.Creates an empty interleave filter list.key()
Returns the builder for row key related filters.Applies the given label to all cells in the output row.limit()
Returns the builder for limit related filters.offset()
Returns the builder for offset related filters.pass()
Matches all cells, regardless of input.Returns the builder for column qualifier related filters.sink()
Outputs all cells directly to the output of the read rather than to any parent filter.Returns the builder for timestamp related filters.value()
Returns the builder for value related filters.
-
Field Details
-
FILTERS
Entry point into the DSL.
-
-
Method Details
-
chain
Creates an empty chain filter list. Filters can be added to the chain by invokingFilters.ChainFilter.filter(Filters.Filter)
.The elements of "filters" are chained together to process the input row:
The full chain is executed atomically.in row -> filter0 -> intermediate row -> filter1 -> ... -> filterN -> out row
-
interleave
Creates an empty interleave filter list. Filters can be added to the interleave by invokingFilters.InterleaveFilter.filter(Filters.Filter)
.The elements of "filters" all process a copy of the input row, and the results are pooled, sorted, and combined into a single output row. If multiple cells are produced with the same column and timestamp, they will all appear in the output row in an unspecified mutual order. The full chain is executed atomically.
-
condition
Creates an empty condition filter. The filter results of the predicate can be configured by invokingFilters.ConditionFilter.then(Filters.Filter)
andFilters.ConditionFilter.otherwise(Filters.Filter)
.A RowFilter which evaluates one of two possible RowFilters, depending on whether or not a predicate RowFilter outputs any cells from the input row.
IMPORTANT NOTE: The predicate filter does not execute atomically with the
Filters.ConditionFilter.then(Filters.Filter)
andFilters.ConditionFilter.otherwise(Filters.Filter)
(Filter)} filters, which may lead to inconsistent or unexpected results. Additionally,Filters.ConditionFilter
may have poor performance, especially when filters are set for theFilters.ConditionFilter.otherwise(Filters.Filter)
. -
key
Returns the builder for row key related filters. -
family
Returns the builder for column family related filters. -
qualifier
Returns the builder for column qualifier related filters. -
timestamp
Returns the builder for timestamp related filters. -
value
Returns the builder for value related filters. -
offset
Returns the builder for offset related filters. -
limit
Returns the builder for limit related filters. -
fromProto
Wraps protobuf representation of a filter.For advanced use only.
-
pass
Matches all cells, regardless of input. Functionally equivalent to having no filter. -
block
Does not match any cells, regardless of input. Useful for temporarily disabling just part of a filter. -
sink
Outputs all cells directly to the output of the read rather than to any parent filter. For advanced usage, see comments in https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto for more details. -
label
Applies the given label to all cells in the output row. This allows the caller to determine which results were produced from which part of the filter.Due to a technical limitation, it is not currently possible to apply multiple labels to a cell. As a result, a
Filters.ChainFilter
may have no more than one sub-filter which contains a label. It is okay for anFilters.InterleaveFilter
to contain multiple labels, as they will be applied to separate copies of the input. This may be relaxed in the future.
-