Search in sources :

Example 16 with Chain

use of com.google.bigtable.v2.RowFilter.Chain in project java-bigtable by googleapis.

the class Query method filter.

/**
 * Sets the filter to apply to each row. Only one filter can be set at a time. To use multiple
 * filters, please use {@link Filters#interleave()} or {@link Filters#chain()}.
 */
public Query filter(Filters.Filter filter) {
    Preconditions.checkNotNull(filter, "filter can't be null");
    RowFilter rowFilter = filter.toProto();
    Preconditions.checkArgument(rowFilter.getSerializedSize() < MAX_FILTER_SIZE, "filter size can't be more than 20KB");
    builder.setFilter(rowFilter);
    return this;
}
Also used : RowFilter(com.google.bigtable.v2.RowFilter)

Aggregations

ReadRowsRequest (com.google.bigtable.v2.ReadRowsRequest)7 RowFilter (com.google.bigtable.v2.RowFilter)6 HeaderTracerUnaryCallable (com.google.cloud.bigtable.data.v2.stub.metrics.HeaderTracerUnaryCallable)6 Test (org.junit.Test)6 ColumnRange (com.google.bigtable.v2.ColumnRange)5 ImmutableMap (com.google.common.collect.ImmutableMap)5 ColumnsWithinFamilyRead (com.spotify.bigtable.read.ReadColumns.ColumnsWithinFamilyRead)5 Map (java.util.Map)5 StatsHeadersUnaryCallable (com.google.cloud.bigtable.data.v2.stub.metrics.StatsHeadersUnaryCallable)4 ByteString (com.google.protobuf.ByteString)4 SpanName (com.google.api.gax.tracing.SpanName)3 TracedUnaryCallable (com.google.api.gax.tracing.TracedUnaryCallable)2 CheckAndMutateRowRequest (com.google.bigtable.v2.CheckAndMutateRowRequest)2 CheckAndMutateRowResponse (com.google.bigtable.v2.CheckAndMutateRowResponse)2 MutateRowsRequest (com.google.bigtable.v2.MutateRowsRequest)2 Chain (com.google.bigtable.v2.RowFilter.Chain)2 Query (com.google.cloud.bigtable.data.v2.models.Query)2 TracedBatcherUnaryCallable (com.google.cloud.bigtable.data.v2.stub.metrics.TracedBatcherUnaryCallable)2 ReadRowsUserCallable (com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsUserCallable)2 ImmutableList (com.google.common.collect.ImmutableList)2