Skip to content

Commit

Permalink
bigtable: initial support (#1279)
Browse files Browse the repository at this point in the history
* bigtable: initial support

add support for scan filters

add examples via jsdoc

add bigtable to docs site

* docs: updated Bigtable README example
  • Loading branch information
callmehiphop authored Jul 11, 2016
1 parent b9fadbc commit 96eb260
Show file tree
Hide file tree
Showing 26 changed files with 8,512 additions and 44 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ To run the system tests, first create and configure a project in the Google Deve
- **GCLOUD_TESTS_KEY**: The path to the JSON key file.
- ***GCLOUD_TESTS_API_KEY*** (*optional*): An API key that can be used to test the Translate API.
- ***GCLOUD_TESTS_DNS_DOMAIN*** (*optional*): A domain you own managed by Google Cloud DNS (expected format: `'gcloud-node.com.'`).
- ***GCLOUD_TESTS_BIGTABLE_ZONE*** (*optional*): A zone containing a Google Cloud Bigtable cluster.
- ***GCLOUD_TESTS_BIGTABLE_CLUSTER*** (*optional*): A cluster used to create Bigtable Tables on.

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`:

Expand Down
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
This client supports the following Google Cloud Platform services:

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


## Google Cloud Bigtable

- [API Documentation][gcloud-bigtable-docs]
- [Official Documentation][cloud-bigtable-docs]

*You may need to [create a cluster][gcloud-bigtable-cluster] to use the Google Cloud Bigtable API with your project.*

#### Preview

```js
var gcloud = require('gcloud');

// Authenticating on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authentication section above).
var bigtable = gcloud.bigtable({
projectId: 'my-project',
keyFilename: '/path/to/keyfile.json',
zone: 'my-zone',
cluster: 'my-cluster'
});

var table = bigtable.table('prezzy');

table.getRows(function(err, rows) {});

// Update a row in your table.
var row = table.row('alincoln');

row.save('follows:gwashington', 1, function(err) {
if (err) {
// Error handling omitted.
}

row.get('follows:gwashington', function(err, data) {
if (err) {
// Error handling omitted.
}

// data = {
// follows: {
// gwashington: [
// {
// value: 1
// }
// ]
// }
// }
});
});
```


## Google Cloud Datastore

- [API Documentation][gcloud-datastore-docs]
Expand Down Expand Up @@ -658,6 +711,7 @@ Apache 2.0 - See [COPYING](COPYING) for more information.
[gcloud-homepage]: https://googlecloudplatform.github.io/gcloud-node/
[gcloud-docs]: https://googlecloudplatform.github.io/gcloud-node/#/docs
[gcloud-bigquery-docs]: https://googlecloudplatform.github.io/gcloud-node/#/docs/bigquery
[gcloud-bigtable-docs]: https://googlecloudplatform.github.io/gcloud-node/#/docs/bigtable
[gcloud-compute-docs]: https://googlecloudplatform.github.io/gcloud-node/#/docs/compute
[gcloud-datastore-docs]: https://googlecloudplatform.github.io/gcloud-node/#/docs/datastore
[gcloud-dns-docs]: https://googlecloudplatform.github.io/gcloud-node/#/docs/dns
Expand Down Expand Up @@ -685,6 +739,9 @@ Apache 2.0 - See [COPYING](COPYING) for more information.

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

[cloud-bigtable-docs]: https://cloud.google.com/bigtable/docs/
[cloud-bigtable-cluster]: https://cloud.google.com/bigtable/docs/creating-cluster

[cloud-compute-docs]: https://cloud.google.com/compute/docs

[cloud-datastore-docs]: https://cloud.google.com/datastore/docs
Expand Down
Empty file.
16 changes: 16 additions & 0 deletions docs/toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@
"title": "Job",
"type": "bigquery/job"
}]
}, {
"title": "Bigtable",
"type": "bigtable",
"nav": [{
"title": "Table",
"type": "bigtable/table"
}, {
"title": "Family",
"type": "bigtable/family"
}, {
"title": "Row",
"type": "bigtable/row"
}, {
"title": "Filter",
"type": "bigtable/filter"
}]
}, {
"title": "Compute",
"type": "compute",
Expand Down
Loading

0 comments on commit 96eb260

Please sign in to comment.