public final class Filters extends Object
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);
}
Modifier and Type | Class and Description |
---|---|
static class |
Filters.ChainFilter
DSL for adding filters to a chain.
|
static class |
Filters.ConditionFilter
DSL for configuring a conditional filter.
|
static class |
Filters.FamilyFilter |
static interface |
Filters.Filter |
static class |
Filters.InterleaveFilter
DSL for adding filters to the interleave list.
|
static class |
Filters.KeyFilter |
static class |
Filters.LimitFilter |
static class |
Filters.OffsetFilter |
static class |
Filters.QualifierFilter |
static class |
Filters.QualifierRangeFilter
Matches only cells from columns within the given range.
|
static class |
Filters.TimestampFilter |
static class |
Filters.TimestampRangeFilter
Matches only cells with microsecond timestamps within the given range.
|
static class |
Filters.ValueFilter |
static class |
Filters.ValueRangeFilter
Matches only cells with values that fall within the given value range.
|
Modifier and Type | Field and Description |
---|---|
static Filters |
FILTERS
Entry point into the DSL.
|
Modifier and Type | Method and Description |
---|---|
Filters.Filter |
block()
Does not match any cells, regardless of input.
|
Filters.ChainFilter |
chain()
Creates an empty chain filter list.
|
Filters.ConditionFilter |
condition(Filters.Filter predicate)
Creates an empty condition filter.
|
Filters.FamilyFilter |
family()
Returns the builder for column family related filters.
|
Filters.Filter |
fromProto(RowFilter rowFilter)
Wraps protobuf representation of a filter.
|
Filters.InterleaveFilter |
interleave()
Creates an empty interleave filter list.
|
Filters.KeyFilter |
key()
Returns the builder for row key related filters.
|
Filters.Filter |
label(String label)
Applies the given label to all cells in the output row.
|
Filters.LimitFilter |
limit()
Returns the builder for limit related filters.
|
Filters.OffsetFilter |
offset()
Returns the builder for offset related filters.
|
Filters.Filter |
pass()
Matches all cells, regardless of input.
|
Filters.QualifierFilter |
qualifier()
Returns the builder for column qualifier related filters.
|
Filters.Filter |
sink()
Outputs all cells directly to the output of the read rather than to any parent filter.
|
Filters.TimestampFilter |
timestamp()
Returns the builder for timestamp related filters.
|
Filters.ValueFilter |
value()
Returns the builder for value related filters.
|
public static final Filters FILTERS
public Filters.ChainFilter chain()
Filters.ChainFilter.filter(Filters.Filter)
.
The elements of "filters" are chained together to process the input row:
in row -> filter0 -> intermediate row -> filter1 -> ... -> filterN -> out row
The full chain is executed atomically.public Filters.InterleaveFilter interleave()
Filters.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.
public Filters.ConditionFilter condition(@Nonnull Filters.Filter predicate)
Filters.ConditionFilter.then(Filters.Filter)
and Filters.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)
and Filters.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 the Filters.ConditionFilter.otherwise(Filters.Filter)
.
public Filters.KeyFilter key()
public Filters.FamilyFilter family()
public Filters.QualifierFilter qualifier()
public Filters.TimestampFilter timestamp()
public Filters.ValueFilter value()
public Filters.OffsetFilter offset()
public Filters.LimitFilter limit()
public Filters.Filter fromProto(RowFilter rowFilter)
For advanced use only.
public Filters.Filter pass()
public Filters.Filter block()
public Filters.Filter sink()
public Filters.Filter label(@Nonnull String label)
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 an Filters.InterleaveFilter
to contain multiple labels, as they will be
applied to separate copies of the input. This may be relaxed in the future.
Copyright © 2019 Google LLC. All rights reserved.