-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1602 from dhermes/move-bigtable-row-filters
Moving all Bigtable row filters into their own module.
- Loading branch information
Showing
16 changed files
with
1,875 additions
and
1,831 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
Bigtable Row Filters | ||
==================== | ||
|
||
It is possible to use a | ||
:class:`RowFilter <gcloud.bigtable.row_filters.RowFilter>` | ||
when adding mutations to a | ||
:class:`ConditionalRow <gcloud.bigtable.row.ConditionalRow>` and when | ||
reading row data with :meth:`read_row() <gcloud.bigtable.table.Table.read_row>` | ||
:meth:`read_rows() <gcloud.bigtable.table.Table.read_rows>`. | ||
|
||
As laid out in the `RowFilter definition`_, the following basic filters | ||
are provided: | ||
|
||
* :class:`SinkFilter <.row_filters.SinkFilter>` | ||
* :class:`PassAllFilter <.row_filters.PassAllFilter>` | ||
* :class:`BlockAllFilter <.row_filters.BlockAllFilter>` | ||
* :class:`RowKeyRegexFilter <.row_filters.RowKeyRegexFilter>` | ||
* :class:`RowSampleFilter <.row_filters.RowSampleFilter>` | ||
* :class:`FamilyNameRegexFilter <.row_filters.FamilyNameRegexFilter>` | ||
* :class:`ColumnQualifierRegexFilter <.row_filters.ColumnQualifierRegexFilter>` | ||
* :class:`TimestampRangeFilter <.row_filters.TimestampRangeFilter>` | ||
* :class:`ColumnRangeFilter <.row_filters.ColumnRangeFilter>` | ||
* :class:`ValueRegexFilter <.row_filters.ValueRegexFilter>` | ||
* :class:`ValueRangeFilter <.row_filters.ValueRangeFilter>` | ||
* :class:`CellsRowOffsetFilter <.row_filters.CellsRowOffsetFilter>` | ||
* :class:`CellsRowLimitFilter <.row_filters.CellsRowLimitFilter>` | ||
* :class:`CellsColumnLimitFilter <.row_filters.CellsColumnLimitFilter>` | ||
* :class:`StripValueTransformerFilter <.row_filters.StripValueTransformerFilter>` | ||
* :class:`ApplyLabelFilter <.row_filters.ApplyLabelFilter>` | ||
|
||
In addition, these filters can be combined into composite filters with | ||
|
||
* :class:`RowFilterChain <.row_filters.RowFilterChain>` | ||
* :class:`RowFilterUnion <.row_filters.RowFilterUnion>` | ||
* :class:`ConditionalRowFilter <.row_filters.ConditionalRowFilter>` | ||
|
||
These rules can be nested arbitrarily, with a basic filter at the lowest | ||
level. For example: | ||
|
||
.. code:: python | ||
# Filter in a specified column (matching any column family). | ||
col1_filter = ColumnQualifierRegexFilter(b'columnbia') | ||
# Create a filter to label results. | ||
label1 = u'label-red' | ||
label1_filter = ApplyLabelFilter(label1) | ||
# Combine the filters to label all the cells in columnbia. | ||
chain1 = RowFilterChain(filters=[col1_filter, label1_filter]) | ||
# Create a similar filter to label cells blue. | ||
col2_filter = ColumnQualifierRegexFilter(b'columnseeya') | ||
label2 = u'label-blue' | ||
label2_filter = ApplyLabelFilter(label2) | ||
chain2 = RowFilterChain(filters=[col2_filter, label2_filter]) | ||
# Bring our two labeled columns together. | ||
row_filter = RowFilterUnion(filters=[chain1, chain2]) | ||
---- | ||
|
||
.. automodule:: gcloud.bigtable.row_filters | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. _RowFilter definition: https://github.com/GoogleCloudPlatform/cloud-bigtable-client/blob/1ff247c2e3b7cd0a2dd49071b2d95beaf6563092/bigtable-protos/src/main/proto/google/bigtable/v1/bigtable_data.proto#L195 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,7 @@ | ||
Bigtable Row | ||
============ | ||
|
||
It is possible to use a :class:`RowFilter <gcloud.bigtable.row.RowFilter>` | ||
when adding mutations to a | ||
:class:`ConditionalRow <gcloud.bigtable.row.ConditionalRow>` and when | ||
reading row data with :meth:`read_row() <gcloud.bigtable.table.Table.read_row>` | ||
:meth:`read_rows() <gcloud.bigtable.table.Table.read_rows>`. | ||
|
||
As laid out in the `RowFilter definition`_, the following basic filters | ||
are provided: | ||
|
||
* :class:`SinkFilter <.row.SinkFilter>` | ||
* :class:`PassAllFilter <.row.PassAllFilter>` | ||
* :class:`BlockAllFilter <.row.BlockAllFilter>` | ||
* :class:`RowKeyRegexFilter <.row.RowKeyRegexFilter>` | ||
* :class:`RowSampleFilter <.row.RowSampleFilter>` | ||
* :class:`FamilyNameRegexFilter <.row.FamilyNameRegexFilter>` | ||
* :class:`ColumnQualifierRegexFilter <.row.ColumnQualifierRegexFilter>` | ||
* :class:`TimestampRangeFilter <.row.TimestampRangeFilter>` | ||
* :class:`ColumnRangeFilter <.row.ColumnRangeFilter>` | ||
* :class:`ValueRegexFilter <.row.ValueRegexFilter>` | ||
* :class:`ValueRangeFilter <.row.ValueRangeFilter>` | ||
* :class:`CellsRowOffsetFilter <.row.CellsRowOffsetFilter>` | ||
* :class:`CellsRowLimitFilter <.row.CellsRowLimitFilter>` | ||
* :class:`CellsColumnLimitFilter <.row.CellsColumnLimitFilter>` | ||
* :class:`StripValueTransformerFilter <.row.StripValueTransformerFilter>` | ||
* :class:`ApplyLabelFilter <.row.ApplyLabelFilter>` | ||
|
||
In addition, these filters can be combined into composite filters with | ||
|
||
* :class:`RowFilterChain <.row.RowFilterChain>` | ||
* :class:`RowFilterUnion <.row.RowFilterUnion>` | ||
* :class:`ConditionalRowFilter <.row.ConditionalRowFilter>` | ||
|
||
These rules can be nested arbitrarily, with a basic filter at the lowest | ||
level. For example: | ||
|
||
.. code:: python | ||
# Filter in a specified column (matching any column family). | ||
col1_filter = ColumnQualifierRegexFilter(b'columnbia') | ||
# Create a filter to label results. | ||
label1 = u'label-red' | ||
label1_filter = ApplyLabelFilter(label1) | ||
# Combine the filters to label all the cells in columnbia. | ||
chain1 = RowFilterChain(filters=[col1_filter, label1_filter]) | ||
# Create a similar filter to label cells blue. | ||
col2_filter = ColumnQualifierRegexFilter(b'columnseeya') | ||
label2 = u'label-blue' | ||
label2_filter = ApplyLabelFilter(label2) | ||
chain2 = RowFilterChain(filters=[col2_filter, label2_filter]) | ||
# Bring our two labeled columns together. | ||
row_filter = RowFilterUnion(filters=[chain1, chain2]) | ||
---- | ||
|
||
.. automodule:: gcloud.bigtable.row | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. _RowFilter definition: https://github.com/GoogleCloudPlatform/cloud-bigtable-client/blob/1ff247c2e3b7cd0a2dd49071b2d95beaf6563092/bigtable-protos/src/main/proto/google/bigtable/v1/bigtable_data.proto#L195 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.