-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Land Bigtable v2 #1932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Land Bigtable v2 #1932
Changes from 6 commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
a43b2eb
Split 'Makefile' into datastore and bigtable portions.
tseaver 0f4a064
Generate Bigtable V2 protos.
tseaver 9d7d8af
Exclude new '_generated_v2' files from coverage.
tseaver 9a2d313
Drop 'Table.rename'.
tseaver f5b1719
Drop overlooked docs / system test usage of 'Table.rename'.
tseaver e570b03
Merge pull request #1903 from tseaver/bigtable-v2-regenerate_protobufs
tseaver 16b04c9
Parse JSON acceptance tests.
tseaver ebf27b5
Add 'ReadRowsResponseV2' wrapper.
tseaver 35103f9
Merge pull request #1908 from tseaver/bigtable-v2-drop_table_rename
tseaver 47b9246
Alias Bigtable V1 imports / factories / entry point constants.
tseaver 377f0da
Merge pull request #1907 from tseaver/bigtable-v2-read_rows_response_…
tseaver cdbc47c
Merge pull request #1912 from tseaver/bigtable-v2-alias_imports_endpo…
tseaver 3c533e0
Factor out generating GCRule-related protobufs.
tseaver 7e9c61d
Update bigtable.column_family to use V2 protos.
tseaver ae3d818
Merge pull request #1913 from tseaver/bigtable-v2-column_family_crud
tseaver 5d179bc
Clarify: testcases leaving incomplete final rows do not raise.
tseaver 6b2f07f
Distinguish response-level errors from invalid chunks.
tseaver fcc3751
Merge pull request #1915 from tseaver/bigtable-v2-readrowsresponse-er…
tseaver 8916b6c
Factor out generating RowFilter-related protobufs.
tseaver 1b0fb53
Convert to non-instance-admin Bigtable V2 protos.
tseaver 3b48e0f
Merge pull request #1919 from tseaver/bigtable-v2-convert_imports
tseaver 4ed0b8f
Drop 'Cluster.table' and 'Cluster.list_tables'.
tseaver 7cbb215
In V2, tables hold a ref. to their instance, not a cluster.
tseaver 498271e
Add V2 Instance type.
tseaver e144b09
Convert instance admin to V2 protobufs.
tseaver 9880a42
Adjust docs for V2 instance admin patterns.
tseaver 90cd2e7
Merge pull request #1923 from tseaver/bigtable-v2-instance_admin
tseaver aa95442
Use 'grpcio-tools' in a virtualenv to generate latest Bigtable V2 pro…
tseaver d97d030
Remove duplicated line.
tseaver 4a223b7
Use 'grpcio-tools' in a virtualenv to generate from latest Bigtable V…
tseaver 568a463
Use 'grpcio-tools' in a virtualenv to generate from latest datastore …
tseaver 24989d6
Accomodate final V2 renames: 'name' -> 'parent'.
tseaver 6d3ff2e
Merge pull request #1925 from tseaver/bigtable-v2-generate_v2_protos_…
tseaver a488a8a
More 'cluster' -> 'instance' renames.
tseaver 7214045
Use (same) actual V2 admin endpoint host for instance / table admin.
tseaver c6b747e
Use class-level constants.
tseaver 40f609e
Add 'Client.list_instances' method.
tseaver c87ca51
Clean out remaining refs to V1-generated code.
tseaver 0ac2def
Merge pull request #1926 from tseaver/bigtable-v2-cleanups
tseaver 3467d99
Work around borked gRPC generation for g.longrunning.operations.
tseaver 784fe01
Revise Bigtable system tests to fit instance-based patterns.
tseaver 024c7f3
Plumb cluster 'location'/'serve_nodes' through instance creation.
tseaver 5e85b5d
CreateInstance operation name includes location.
tseaver d2c9daf
'Row/ColumnFamily._table' has '_instance'.
tseaver a01d02e
V2 UpdateTable no longer returns operation.
tseaver 9bdeef7
'PartialRowData' no longer keeps 'committed' state.
tseaver 893d451
Typo fix.
tseaver d8a01c2
Switch to passing location ID, rather than full path, to instance.
tseaver 6f4aced
Lint fixes.
tseaver 0c625c5
Merge pull request #1930 from tseaver/bigtable-v2-system_tests
tseaver 82adc5e
Adjust to V2 'instance'-based patterns.
tseaver 40b2016
Rename testcases for clarity.
tseaver 9dfa823
'Table.read_rows': no responses -> None.
tseaver e92da5c
V2 wraps row for 'ReadModifyWriteRow' request in new response message
tseaver 0e80bdd
happybase.Table.scan: proocess all rows from a single request.
tseaver d18a316
Valet service.
tseaver d085294
Merge pull request #1931 from tseaver/bigtable-v2-happybase
tseaver File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,133 @@ | ||
| Instance Admin API | ||
| ================== | ||
|
|
||
| .. warning:: | ||
|
|
||
| gRPC is required for using the Cloud Bigtable API. As of May 2016, | ||
| ``grpcio`` is only supported in Python 2.7, so importing | ||
| :mod:`gcloud.bigtable` in other versions of Python will fail. | ||
|
|
||
| After creating a :class:`Client <gcloud.bigtable.client.Client>`, you can | ||
| interact with individual instances for a project. | ||
|
|
||
| List Intances | ||
| ------------- | ||
|
|
||
| If you want a comprehensive list of all existing intances, make a | ||
| `ListInstances`_ API request with | ||
| :meth:`Client.list_intances() <gcloud.bigtable.client.Client.list_intances>`: | ||
|
|
||
| .. code:: python | ||
|
|
||
| intances = client.list_intances() | ||
|
|
||
| Instance Factory | ||
| ---------------- | ||
|
|
||
| To create a :class:`Instance <gcloud.bigtable.instance.Instance>` object: | ||
|
|
||
| .. code:: python | ||
|
|
||
| instance = client.instance(instance_id, display_name=display_name) | ||
|
|
||
| ``display_name`` is optional. When not provided, | ||
| ``display_name`` defaults to the ``instance_id`` value. | ||
|
|
||
| Even if this :class:`Instance <gcloud.bigtable.instance.Instance>` already | ||
| has been created with the API, you'll want this object to use as a | ||
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
Sorry, something went wrong. |
||
| parent of a :class:`Table <gcloud.bigtable.table.Table>` just as the | ||
| :class:`Client <gcloud.bigtable.client.Client>` is used as the parent of | ||
| a :class:`Instance <gcloud.bigtable.instance.Instance>`. | ||
|
|
||
| Create a new Instance | ||
| --------------------- | ||
|
|
||
| After creating the instance object, make a `CreateInstance`_ API request | ||
| with :meth:`create() <gcloud.bigtable.instance.Instance.create>`: | ||
|
|
||
| .. code:: python | ||
|
|
||
| instance.display_name = 'My very own instance' | ||
| instance.create() | ||
|
|
||
| Check on Current Operation | ||
| -------------------------- | ||
|
|
||
| .. note:: | ||
|
|
||
| When modifying a instance (via a `CreateInstance`_ request), the Bigtable | ||
| API will return a `long-running operation`_ and a corresponding | ||
| :class:`Operation <gcloud.bigtable.instance.Operation>` object | ||
| will be returned by | ||
| :meth:`create() <gcloud.bigtable.instance.Instance.create>``. | ||
|
|
||
| You can check if a long-running operation (for a | ||
| :meth:`create() <gcloud.bigtable.instance.Instance.create>` has finished | ||
| by making a `GetOperation`_ request with | ||
| :meth:`Operation.finished() <gcloud.bigtable.instance.Operation.finished>`: | ||
|
|
||
| .. code:: python | ||
|
|
||
| >>> operation = instance.create() | ||
| >>> operation.finished() | ||
| True | ||
|
|
||
| .. note:: | ||
|
|
||
| Once an :class:`Operation <gcloud.bigtable.instance.Operation>` object | ||
| has returned :data:`True` from | ||
| :meth:`finished() <gcloud.bigtable.instance.Operation.finished>`, the | ||
| object should not be re-used. Subsequent calls to | ||
| :meth:`finished() <gcloud.bigtable.instance.Operation.finished>` | ||
| will result in a :class:`ValueError <exceptions.ValueError>`. | ||
|
|
||
| Get metadata for an existing Instance | ||
| ------------------------------------- | ||
|
|
||
| After creating the instance object, make a `GetInstance`_ API request | ||
| with :meth:`reload() <gcloud.bigtable.instance.Instance.reload>`: | ||
|
|
||
| .. code:: python | ||
|
|
||
| instance.reload() | ||
|
|
||
| This will load ``display_name`` for the existing ``instance`` object. | ||
|
|
||
| Update an existing Instance | ||
| --------------------------- | ||
|
|
||
| After creating the instance object, make an `UpdateInstance`_ API request | ||
| with :meth:`update() <gcloud.bigtable.instance.Instance.update>`: | ||
|
|
||
| .. code:: python | ||
|
|
||
| client.display_name = 'New display_name' | ||
| instance.update() | ||
|
|
||
| Delete an existing Instance | ||
| --------------------------- | ||
|
|
||
| Make a `DeleteInstance`_ API request with | ||
| :meth:`delete() <gcloud.bigtable.instance.Instance.delete>`: | ||
|
|
||
| .. code:: python | ||
|
|
||
| instance.delete() | ||
|
|
||
| Next Step | ||
| --------- | ||
|
|
||
| Now we go down the hierarchy from | ||
| :class:`Instance <gcloud.bigtable.instance.Instance>` to a | ||
| :class:`Table <gcloud.bigtable.table.Table>`. | ||
|
|
||
| Head next to learn about the :doc:`bigtable-table-api`. | ||
|
|
||
| .. _Instance Admin API: https://cloud.google.com/bigtable/docs/creating-instance | ||
| .. _CreateInstance: https://github.com/GoogleCloudPlatform/cloud-bigtable-client/blob/2aae624081f652427052fb652d3ae43d8ac5bf5a/bigtable-protos/src/main/proto/google/bigtable/admin/instance/v1/bigtable_instance_service.proto#L66-L68 | ||
| .. _GetInstance: https://github.com/GoogleCloudPlatform/cloud-bigtable-client/blob/2aae624081f652427052fb652d3ae43d8ac5bf5a/bigtable-protos/src/main/proto/google/bigtable/admin/instance/v1/bigtable_instance_service.proto#L38-L40 | ||
| .. _UpdateInstance: https://github.com/GoogleCloudPlatform/cloud-bigtable-client/blob/2aae624081f652427052fb652d3ae43d8ac5bf5a/bigtable-protos/src/main/proto/google/bigtable/admin/instance/v1/bigtable_instance_service.proto#L93-L95 | ||
| .. _DeleteInstance: https://github.com/GoogleCloudPlatform/cloud-bigtable-client/blob/2aae624081f652427052fb652d3ae43d8ac5bf5a/bigtable-protos/src/main/proto/google/bigtable/admin/instance/v1/bigtable_instance_service.proto#L109-L111 | ||
| .. _ListInstances: https://github.com/GoogleCloudPlatform/cloud-bigtable-client/blob/2aae624081f652427052fb652d3ae43d8ac5bf5a/bigtable-protos/src/main/proto/google/bigtable/admin/instance/v1/bigtable_instance_service.proto#L44-L46 | ||
| .. _GetOperation: https://github.com/GoogleCloudPlatform/cloud-bigtable-client/blob/2aae624081f652427052fb652d3ae43d8ac5bf5a/bigtable-protos/src/main/proto/google/longrunning/operations.proto#L43-L45 | ||
| .. _long-running operation: https://github.com/GoogleCloudPlatform/cloud-bigtable-client/blob/2aae624081f652427052fb652d3ae43d8ac5bf5a/bigtable-protos/src/main/proto/google/longrunning/operations.proto#L73-L102 | ||
This file contains hidden or 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,12 @@ | ||
| Instance | ||
| ~~~~~~~~ | ||
|
|
||
| .. warning:: | ||
|
|
||
| gRPC is required for using the Cloud Bigtable API. As of May 2016, | ||
| ``grpcio`` is only supported in Python 2.7, so importing | ||
| :mod:`gcloud.bigtable` in other versions of Python will fail. | ||
|
|
||
| .. automodule:: gcloud.bigtable.instance | ||
| :members: | ||
| :show-inheritance: |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.