Skip to content

Commit 96eb260

Browse files
authored
bigtable: initial support (#1279)
* bigtable: initial support add support for scan filters add examples via jsdoc add bigtable to docs site * docs: updated Bigtable README example
1 parent b9fadbc commit 96eb260

26 files changed

+8512
-44
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ To run the system tests, first create and configure a project in the Google Deve
2323
- **GCLOUD_TESTS_KEY**: The path to the JSON key file.
2424
- ***GCLOUD_TESTS_API_KEY*** (*optional*): An API key that can be used to test the Translate API.
2525
- ***GCLOUD_TESTS_DNS_DOMAIN*** (*optional*): A domain you own managed by Google Cloud DNS (expected format: `'gcloud-node.com.'`).
26+
- ***GCLOUD_TESTS_BIGTABLE_ZONE*** (*optional*): A zone containing a Google Cloud Bigtable cluster.
27+
- ***GCLOUD_TESTS_BIGTABLE_CLUSTER*** (*optional*): A cluster used to create Bigtable Tables on.
2628

2729
Install the [gcloud command-line tool][gcloudcli] to your machine and use it to create the indexes used in the datastore system tests with indexes found in `system-test/data/index/yaml`:
2830

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
This client supports the following Google Cloud Platform services:
1212

1313
* [Google BigQuery](#google-bigquery)
14+
* [Google Cloud Bigtable](#google-cloud-bigtable)
1415
* [Google Cloud Datastore](#google-cloud-datastore)
1516
* [Google Cloud DNS](#google-cloud-dns)
1617
* [Google Cloud Pub/Sub](#google-cloud-pubsub)
@@ -120,6 +121,58 @@ job.getQueryResults().on('data', function(row) {});
120121
```
121122

122123

124+
## Google Cloud Bigtable
125+
126+
- [API Documentation][gcloud-bigtable-docs]
127+
- [Official Documentation][cloud-bigtable-docs]
128+
129+
*You may need to [create a cluster][gcloud-bigtable-cluster] to use the Google Cloud Bigtable API with your project.*
130+
131+
#### Preview
132+
133+
```js
134+
var gcloud = require('gcloud');
135+
136+
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
137+
// global basis (see Authentication section above).
138+
var bigtable = gcloud.bigtable({
139+
projectId: 'my-project',
140+
keyFilename: '/path/to/keyfile.json',
141+
zone: 'my-zone',
142+
cluster: 'my-cluster'
143+
});
144+
145+
var table = bigtable.table('prezzy');
146+
147+
table.getRows(function(err, rows) {});
148+
149+
// Update a row in your table.
150+
var row = table.row('alincoln');
151+
152+
row.save('follows:gwashington', 1, function(err) {
153+
if (err) {
154+
// Error handling omitted.
155+
}
156+
157+
row.get('follows:gwashington', function(err, data) {
158+
if (err) {
159+
// Error handling omitted.
160+
}
161+
162+
// data = {
163+
// follows: {
164+
// gwashington: [
165+
// {
166+
// value: 1
167+
// }
168+
// ]
169+
// }
170+
// }
171+
});
172+
});
173+
```
174+
175+
123176
## Google Cloud Datastore
124177

125178
- [API Documentation][gcloud-datastore-docs]
@@ -658,6 +711,7 @@ Apache 2.0 - See [COPYING](COPYING) for more information.
658711
[gcloud-homepage]: https://googlecloudplatform.github.io/gcloud-node/
659712
[gcloud-docs]: https://googlecloudplatform.github.io/gcloud-node/#/docs
660713
[gcloud-bigquery-docs]: https://googlecloudplatform.github.io/gcloud-node/#/docs/bigquery
714+
[gcloud-bigtable-docs]: https://googlecloudplatform.github.io/gcloud-node/#/docs/bigtable
661715
[gcloud-compute-docs]: https://googlecloudplatform.github.io/gcloud-node/#/docs/compute
662716
[gcloud-datastore-docs]: https://googlecloudplatform.github.io/gcloud-node/#/docs/datastore
663717
[gcloud-dns-docs]: https://googlecloudplatform.github.io/gcloud-node/#/docs/dns
@@ -685,6 +739,9 @@ Apache 2.0 - See [COPYING](COPYING) for more information.
685739

686740
[cloud-bigquery-docs]: https://cloud.google.com/bigquery/what-is-bigquery
687741

742+
[cloud-bigtable-docs]: https://cloud.google.com/bigtable/docs/
743+
[cloud-bigtable-cluster]: https://cloud.google.com/bigtable/docs/creating-cluster
744+
688745
[cloud-compute-docs]: https://cloud.google.com/compute/docs
689746

690747
[cloud-datastore-docs]: https://cloud.google.com/datastore/docs

docs/json/master/bigtable/.gitkeep

Whitespace-only changes.

docs/toc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,22 @@
4646
"title": "Job",
4747
"type": "bigquery/job"
4848
}]
49+
}, {
50+
"title": "Bigtable",
51+
"type": "bigtable",
52+
"nav": [{
53+
"title": "Table",
54+
"type": "bigtable/table"
55+
}, {
56+
"title": "Family",
57+
"type": "bigtable/family"
58+
}, {
59+
"title": "Row",
60+
"type": "bigtable/row"
61+
}, {
62+
"title": "Filter",
63+
"type": "bigtable/filter"
64+
}]
4965
}, {
5066
"title": "Compute",
5167
"type": "compute",

0 commit comments

Comments
 (0)