Constructor
new BigtableClient(optionsopt)
Construct an instance of BigtableClient.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
The configuration object. See the subsequent parameters for more details. Properties
|
- Source:
Members
(static) apiEndpoint
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
- Source:
(static) port
The port for this API service.
- Source:
(static) scopes
The scopes needed to make gRPC calls for every method defined in this service.
- Source:
(static) servicePath
The DNS address for this API service.
- Source:
Methods
checkAndMutateRow(request, optionsopt, callbackopt) → {Promise}
Mutates a row atomically based on the output of a predicate Reader filter.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing CheckAndMutateRowResponse. |
- Source:
Example
const bigtable = require('@google-cloud/bigtable');
const client = new bigtable.v2.BigtableClient({
// optional auth parameters.
});
const formattedTableName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
const rowKey = Buffer.from('');
const request = {
tableName: formattedTableName,
rowKey: rowKey,
};
client.checkAndMutateRow(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
getProjectId(callback)
Return the project ID used by this class.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
the callback to be called with the current project Id. |
- Source:
matchInstanceFromTableName(tableName) → {String}
Parse the tableName from a table resource.
Parameters:
Name | Type | Description |
---|---|---|
tableName |
String |
A fully-qualified path representing a table resources. |
- Source:
matchProjectFromTableName(tableName) → {String}
Parse the tableName from a table resource.
Parameters:
Name | Type | Description |
---|---|---|
tableName |
String |
A fully-qualified path representing a table resources. |
- Source:
matchTableFromTableName(tableName) → {String}
Parse the tableName from a table resource.
Parameters:
Name | Type | Description |
---|---|---|
tableName |
String |
A fully-qualified path representing a table resources. |
- Source:
mutateRow(request, optionsopt, callbackopt) → {Promise}
Mutates a row atomically. Cells already present in the row are left
unchanged unless explicitly changed by mutation
.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing MutateRowResponse. |
- Source:
Example
const bigtable = require('@google-cloud/bigtable');
const client = new bigtable.v2.BigtableClient({
// optional auth parameters.
});
const formattedTableName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
const rowKey = Buffer.from('');
const mutations = [];
const request = {
tableName: formattedTableName,
rowKey: rowKey,
mutations: mutations,
};
client.mutateRow(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
mutateRows(request, optionsopt) → {Stream}
Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow, but the entire batch is not executed atomically.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
- Source:
Example
const bigtable = require('@google-cloud/bigtable');
const client = new bigtable.v2.BigtableClient({
// optional auth parameters.
});
const formattedTableName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
const entries = [];
const request = {
tableName: formattedTableName,
entries: entries,
};
client.mutateRows(request).on('data', response => {
// doThingsWith(response)
});
readModifyWriteRow(request, optionsopt, callbackopt) → {Promise}
Modifies a row atomically on the server. The method reads the latest existing timestamp and value from the specified columns and writes a new entry based on pre-defined read/modify/write rules. The new value for the timestamp is the greater of the existing timestamp or the current server time. The method returns the new contents of all modified cells.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing ReadModifyWriteRowResponse. |
- Source:
Example
const bigtable = require('@google-cloud/bigtable');
const client = new bigtable.v2.BigtableClient({
// optional auth parameters.
});
const formattedTableName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
const rowKey = Buffer.from('');
const rules = [];
const request = {
tableName: formattedTableName,
rowKey: rowKey,
rules: rules,
};
client.readModifyWriteRow(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
readRows(request, optionsopt) → {Stream}
Streams back the contents of all requested rows in key order, optionally applying the same Reader filter to each. Depending on their size, rows and cells may be broken up across multiple responses, but atomicity of each row will still be preserved. See the ReadRowsResponse documentation for details.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
- Source:
Example
const bigtable = require('@google-cloud/bigtable');
const client = new bigtable.v2.BigtableClient({
// optional auth parameters.
});
const formattedTableName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
client.readRows({tableName: formattedTableName}).on('data', response => {
// doThingsWith(response)
});
sampleRowKeys(request, optionsopt) → {Stream}
Returns a sample of row keys in the table. The returned row keys will delimit contiguous sections of the table of approximately equal size, which can be used to break up the data for distributed tasks like mapreduces.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
- Source:
Example
const bigtable = require('@google-cloud/bigtable');
const client = new bigtable.v2.BigtableClient({
// optional auth parameters.
});
const formattedTableName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
client.sampleRowKeys({tableName: formattedTableName}).on('data', response => {
// doThingsWith(response)
});
tablePath(project, instance, table) → {String}
Return a fully-qualified table resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
String | |
instance |
String | |
table |
String |
- Source: