Class RowFilters (2.3.0)

public static class RowFilters

Static class with convenience methods for creating various kinds of RowFilter instances.

Inheritance

Object > RowFilters

Namespace

Google.Cloud.Bigtable.V2

Assembly

Google.Cloud.Bigtable.V2.dll

Methods

BlockAllFilter()

public static RowFilter BlockAllFilter()

Creates a new RowFilter instance which does not match any cells, regardless of input. Useful for temporarily disabling just part of a filter.

Returns
TypeDescription
RowFilter

The created row filter.

CellsPerColumnLimit(Int32)

public static RowFilter CellsPerColumnLimit(int limit)

Creates a new RowFilter instance which matches only the most recent N cells within each column.

Parameter
NameDescription
limitInt32

The maximum number of cells allowed per column.

Returns
TypeDescription
RowFilter

The created row filter.

Remarks

For example, if N=2, this filter would match column foo:bar at timestamps 10 and 9, skip all earlier cells in foo:bar, and then begin matching again in column foo:bar2.

If duplicate cells are present, as is possible when using an Interleave, each copy of the cell is counted separately.

CellsPerRowLimit(Int32)

public static RowFilter CellsPerRowLimit(int limit)

Creates a new RowFilter instance which matches only the first N cells of each row.

Parameter
NameDescription
limitInt32

The maximum number of cells allowed per row.

Returns
TypeDescription
RowFilter

The created row filter.

Remarks

If duplicate cells are present, as is possible when using an Interleave, each copy of the cell is counted separately.

CellsPerRowOffset(Int32)

public static RowFilter CellsPerRowOffset(int offset)

Creates a new RowFilter instance which skips the first N cells of each row, matching all subsequent cells.

Parameter
NameDescription
offsetInt32

The number of cells to skip per row.

Returns
TypeDescription
RowFilter

The created row filter.

Remarks

If duplicate cells are present, as is possible when using an Interleave, each copy of the cell is counted separately.

Chain(RowFilter[])

public static RowFilter Chain(params RowFilter[] filters)

Creates a new RowFilter instance which sends rows through several RowFilters in sequence.

Parameter
NameDescription
filtersRowFilter[]

The elements of "filters" are chained together to process the input row: in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row The full chain is executed atomically. Must not be null, or contain null elements.

Returns
TypeDescription
RowFilter

The created row filter.

ColumnQualifierExact(BigtableByteString)

public static RowFilter ColumnQualifierExact(BigtableByteString value)

Creates a new RowFilter instance which matches only cells from columns whose qualifiers match the exact byte string specified.

Parameter
NameDescription
valueBigtableByteString

The exact value used to match column qualifiers.

Returns
TypeDescription
RowFilter

The created row filter.

Remarks

Note that string is implicitly convertible to BigtableByteString, so value can be specified using a string as well and its UTF-8 representations will be used.

ColumnQualifierRegex(String)

public static RowFilter ColumnQualifierRegex(string regex)

Creates a new RowFilter instance which matches only cells from columns whose qualifiers satisfy the given RE2 regex.

Parameter
NameDescription
regexString

The RE2 regex used to match column qualifiers.

Returns
TypeDescription
RowFilter

The created row filter.

Remarks

The format of RE2 is documented at https://github.com/google/re2/wiki/Syntax.

Note that, since column qualifiers can contain arbitrary bytes, the \C escape sequence must be used if a true wildcard is desired. The . character will not match the new line character \n, which may be present in a binary qualifier.

ColumnRange(ColumnRange)

public static RowFilter ColumnRange(ColumnRange range)

Creates a new RowFilter instance which matches only cells from columns within the given range.

Parameter
NameDescription
rangeColumnRange

The range of columns from which cells should be matched. Must not be null.

Returns
TypeDescription
RowFilter

The created row filter.

Condition(RowFilter, RowFilter, RowFilter)

public static RowFilter Condition(RowFilter predicateFilter, RowFilter trueFilter, RowFilter falseFilter)

Creates a new RowFilter instance which applies one of two possible RowFilters to the data based on the output of a predicate RowFilter.

Parameters
NameDescription
predicateFilterRowFilter

If predicateFilter outputs any cells, then trueFilter will be evaluated on the input row. Otherwise, falseFilter will be evaluated.

trueFilterRowFilter

The filter to apply to the input row if predicateFilter returns any results. If null, no results will be returned in the true case.

falseFilterRowFilter

The filter to apply to the input row if predicateFilter does not return any results. If null, no results will be returned in the false case.

Returns
TypeDescription
RowFilter

The created row filter.

FamilyNameExact(String)

public static RowFilter FamilyNameExact(string value)

Creates a new RowFilter instance which matches only cells from column families whose names match the exact string specified.

Parameter
NameDescription
valueString

The exact value used to match column families. Must not be null

Returns
TypeDescription
RowFilter

The created row filter.

Remarks

Note that string is implicitly convertible to BigtableByteString, so value can be specified using a string as well and its UTF-8 representations will be used.

FamilyNameRegex(String)

public static RowFilter FamilyNameRegex(string regex)

Creates a new RowFilter instance which matches only cells from columns whose families satisfy the given RE2 regex.

Parameter
NameDescription
regexString

The RE2 regex used to match column families. Must not be null.

Returns
TypeDescription
RowFilter

The created row filter.

Remarks

For technical reasons, the regex must not contain the : character, even if it is not being used as a literal. Note that, since column families cannot contain the new line character \n, it is sufficient to use . as a full wildcard when matching column family names.

Interleave(RowFilter[])

public static RowFilter Interleave(params RowFilter[] filters)

Creates a new RowFilter instance which applies several RowFilters to the data in parallel and combines the results.

Parameter
NameDescription
filtersRowFilter[]

The filters to apply in parallel. Must not be null, or contain null elements.

Returns
TypeDescription
RowFilter

The created row filter.

PassAllFilter()

public static RowFilter PassAllFilter()

Creates a new RowFilter instance which matches all cells, regardless of input. Functionally equivalent to leaving filter unset, but included for completeness.

Returns
TypeDescription
RowFilter

The created row filter.

RowKeyExact(BigtableByteString)

public static RowFilter RowKeyExact(BigtableByteString value)

Creates a new RowFilter instance which matches only cells from rows whose keys match the exact byte string specified.

Parameter
NameDescription
valueBigtableByteString

The exact value used to match row keys.

Returns
TypeDescription
RowFilter

The created row filter.

Remarks

Note that string is implicitly convertible to BigtableByteString, so value can be specified using a string as well and its UTF-8 representations will be used.

RowKeyRegex(String)

public static RowFilter RowKeyRegex(string regex)

Creates a new RowFilter instance which matches only cells from rows whose keys satisfy the given RE2 regex. In other words, passes through the entire row when the key matches, and otherwise produces an empty row.

Parameter
NameDescription
regexString

The RE2 regex used to match row keys.

Returns
TypeDescription
RowFilter

The created row filter.

Remarks

The format of RE2 is documented at https://github.com/google/re2/wiki/Syntax.

Note that, since row keys can contain arbitrary bytes, the \C escape sequence must be used if a true wildcard is desired. The . character will not match the new line character \n, which may be present in a binary key.

RowSample(Double)

public static RowFilter RowSample(double probability)

Creates a new RowFilter instance which matches all cells from a row with probability p, and matches no cells from the row with probability 1-p.

Parameter
NameDescription
probabilityDouble

The probability with which rows should be matched. Must be between 0 and 1, inclusive.

Returns
TypeDescription
RowFilter

The created row filter.

StripValueTransformer()

public static RowFilter StripValueTransformer()

Creates a new RowFilter instance which replaces each cell's value with the empty string. This is useful for increasing performance when only getting cell counts rather than cell values.

Returns
TypeDescription
RowFilter

The created row filter.

TimestampRange(Nullable<DateTime>, Nullable<DateTime>)

public static RowFilter TimestampRange(DateTime? startTimestamp, DateTime? endTimestamp)

Creates a new RowFilter instance which matches only cells with versions within the given range.

Parameters
NameDescription
startTimestampNullable<DateTime>

Of the range of versions from which cells should be matched, inclusive lower bound timestamp whose milliseconds since the Unix epoch should be used as the version value. If null, interpreted as 0. It must be specified in UTC.

endTimestampNullable<DateTime>

Of the range of versions from which cells should be matched, exclusive upper bound timestamp whose milliseconds since the Unix epoch should be used as the version value. If null, interpreted as infinity. It must be specified in UTC.

Returns
TypeDescription
RowFilter

The created row filter.

Remarks

Note: version values are stored on the server as if they are microseconds since the Unix epoch. However, the server only supports millisecond granularity, so the server only allows microseconds in multiples of 1,000. BigtableVersion attempts to hide this complexity by exposing its underlying Value in terms of milliseconds, so if desired, a custom versioning scheme of 1, 2, ... can be used rather than 1000, 2000, ... However, access to the underlying microsecond value is still provided via Micros.

Note: when using ReadModifyWriteRow, modified columns automatically use a server version, which is based on the current timestamp since the Unix epoch. For those columns, other reads and writes should use BigtableVersion values constructed from DateTime values, as opposed to using a custom versioning scheme with 64-bit values.

ValueExact(BigtableByteString)

public static RowFilter ValueExact(BigtableByteString value)

Creates a new RowFilter instance which matches only cells with values that match the exact byte string specified.

Parameter
NameDescription
valueBigtableByteString

The exact value used to match cell values.

Returns
TypeDescription
RowFilter

The created row filter.

Remarks

Note that string is implicitly convertible to BigtableByteString, so value can be specified using a string as well and its UTF-8 representations will be used.

ValueRange(ValueRange)

public static RowFilter ValueRange(ValueRange range)

Creates a new RowFilter instance which matches only cells with values that fall within the given range.

Parameter
NameDescription
rangeValueRange

The range of values to match. Must not be null.

Returns
TypeDescription
RowFilter

The created row filter.

ValueRegex(String)

public static RowFilter ValueRegex(string regex)

Creates a new RowFilter instance which matches only cells with values that satisfy the given regular expression.

Parameter
NameDescription
regexString

The RE2 regex used to match cell values.

Returns
TypeDescription
RowFilter

The created row filter.

Remarks

The format of RE2 is documented at https://github.com/google/re2/wiki/Syntax.

Note that, since cell values can contain arbitrary bytes, the \C escape sequence must be used if a true wildcard is desired. The . character will not match the new line character \n, which may be present in a binary value.

VersionRange(BigtableVersionRange)

public static RowFilter VersionRange(BigtableVersionRange range)

Creates a new RowFilter instance which matches only cells with versions within the given range.

Parameter
NameDescription
rangeBigtableVersionRange

The range of versions from which cells should be matched. Must not be null.

Returns
TypeDescription
RowFilter

The created row filter.