Class BigtableClient (2.2.0)

public abstract class BigtableClient

BigtableServiceApi client wrapper, for convenient use.

Inheritance

Object > BigtableClient

Derived Types

Namespace

Google.Cloud.Bigtable.V2

Assembly

Google.Cloud.Bigtable.V2.dll

Remarks

Service for reading from and writing to existing Bigtable tables.

Properties

AppProfileId

public virtual string AppProfileId { get; }

Gets the value which specifies routing for replication. If null or empty, the "default" application profile will be used by the server.

Property Value
TypeDescription
String

Methods

CheckAndMutateRow(TableName, BigtableByteString, RowFilter, Mutation[])

public virtual CheckAndMutateRowResponse CheckAndMutateRow(TableName tableName, BigtableByteString rowKey, RowFilter predicateFilter, params Mutation[] trueMutations)

Mutates a row atomically based on the output of a predicate Reader filter.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the conditional mutation should be applied. Must not be null.

rowKeyGoogle.Cloud.Bigtable.Common.V2.BigtableByteString

The key of the row to which the conditional mutation should be applied. Must not be empty.

predicateFilterRowFilter

The filter to be applied to the contents of the specified row. Depending on whether or not any results are yielded, trueMutations may or may not be executed. If null, checks that the row contains any values at all.

trueMutationsMutation[]

Changes to be atomically applied to the specified row if predicateFilter yields at least one cell when applied to rowKey. Entries are applied in order, meaning that earlier mutations can be masked by later ones. Must contain at least one entry and at most 100000. Must not be null, or contain null elements.

Returns
TypeDescription
CheckAndMutateRowResponse

The response from trying to mutate the row.

Remarks

Note that string is implicitly convertible to Google.Cloud.Bigtable.Common.V2.BigtableByteString, so rowKey can be specified using a string as well and its UTF-8 representations will be used.

This method simply delegates to CheckAndMutateRow(CheckAndMutateRowRequest, CallSettings).

CheckAndMutateRow(TableName, BigtableByteString, RowFilter, IEnumerable<Mutation>, IEnumerable<Mutation>, CallSettings)

public virtual CheckAndMutateRowResponse CheckAndMutateRow(TableName tableName, BigtableByteString rowKey, RowFilter predicateFilter, IEnumerable<Mutation> trueMutations, IEnumerable<Mutation> falseMutations, CallSettings callSettings = null)

Mutates a row atomically based on the output of a predicate Reader filter.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the conditional mutation should be applied. Must not be null.

rowKeyGoogle.Cloud.Bigtable.Common.V2.BigtableByteString

The key of the row to which the conditional mutation should be applied. Must not be empty.

predicateFilterRowFilter

The filter to be applied to the contents of the specified row. Depending on whether or not any results are yielded, either trueMutations or falseMutations will be executed. If null, checks that the row contains any values at all.

trueMutationsIEnumerable<Mutation>

Changes to be atomically applied to the specified row if predicateFilter yields at least one cell when applied to rowKey. Entries are applied in order, meaning that earlier mutations can be masked by later ones. Must contain at least one entry if falseMutations is null or empty, and at most 100000. Can be null or empty, but must not contain null elements.

falseMutationsIEnumerable<Mutation>

Changes to be atomically applied to the specified row if predicateFilter does not yield any cells when applied to rowKey. Entries are applied in order, meaning that earlier mutations can be masked by later ones. Must contain at least one entry if trueMutations is null or empty, and at most 100000. Can be null or empty, but must not contain null elements.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
CheckAndMutateRowResponse

The response from trying to mutate the row.

Remarks

Note that string is implicitly convertible to Google.Cloud.Bigtable.Common.V2.BigtableByteString, so rowKey can be specified using a string as well and its UTF-8 representations will be used.

This method simply delegates to CheckAndMutateRow(CheckAndMutateRowRequest, CallSettings).

CheckAndMutateRow(CheckAndMutateRowRequest, CallSettings)

public virtual CheckAndMutateRowResponse CheckAndMutateRow(CheckAndMutateRowRequest request, CallSettings callSettings = null)

Mutates a row atomically based on the output of a predicate Reader filter.

Parameters
NameDescription
requestCheckAndMutateRowRequest

The request object containing all of the parameters for the API call. If the AppProfileId has not been specified, it will be initialized from the value stored in the client.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
CheckAndMutateRowResponse

The RPC response.

CheckAndMutateRowAsync(TableName, BigtableByteString, RowFilter, Mutation[])

public virtual Task<CheckAndMutateRowResponse> CheckAndMutateRowAsync(TableName tableName, BigtableByteString rowKey, RowFilter predicateFilter, params Mutation[] trueMutations)

Asynchronously mutates a row atomically based on the output of a predicate Reader filter.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the conditional mutation should be applied. Must not be null.

rowKeyGoogle.Cloud.Bigtable.Common.V2.BigtableByteString

The key of the row to which the conditional mutation should be applied. Must not be empty.

predicateFilterRowFilter

The filter to be applied to the contents of the specified row. Depending on whether or not any results are yielded, trueMutations may or may not be executed. If null, checks that the row contains any values at all.

trueMutationsMutation[]

Changes to be atomically applied to the specified row if predicateFilter yields at least one cell when applied to rowKey. Entries are applied in order, meaning that earlier mutations can be masked by later ones. Must contain at least one entry and at most 100000. Must not be null, or contain null elements.

Returns
TypeDescription
Task<CheckAndMutateRowResponse>

The response from trying to mutate the row.

Remarks

Note that string is implicitly convertible to Google.Cloud.Bigtable.Common.V2.BigtableByteString, so rowKey can be specified using a string as well and its UTF-8 representations will be used.

This method simply delegates to CheckAndMutateRowAsync(CheckAndMutateRowRequest, CallSettings).

Example
CheckAndMutateRowResponse response = await client.CheckAndMutateRowAsync(
    new TableName(projectId, instanceId, tableId),
    "user12345",
    // If the latest value in the "Address:Country" column is "USA"...
    RowFilters.Chain(
        RowFilters.FamilyNameExact("Address"),
        RowFilters.ColumnQualifierExact("Country"),
        RowFilters.CellsPerColumnLimit(1),
        RowFilters.ValueExact("USA")),
    // ...remove all previous Level 1 scores and set the value to 0.
    Mutations.DeleteFromColumn("Score", "Level 1"),
    Mutations.SetCell("Score", "Level 1", 0, new BigtableVersion(1)));

if (response.PredicateMatched)
{
    Console.WriteLine("The level 1 scores have been reset");
}
else
{
    Console.WriteLine("The level 1 scores were not modified.");
}

CheckAndMutateRowAsync(TableName, BigtableByteString, RowFilter, IEnumerable<Mutation>, IEnumerable<Mutation>, CallSettings)

public virtual Task<CheckAndMutateRowResponse> CheckAndMutateRowAsync(TableName tableName, BigtableByteString rowKey, RowFilter predicateFilter, IEnumerable<Mutation> trueMutations, IEnumerable<Mutation> falseMutations, CallSettings callSettings = null)

Asynchronously mutates a row atomically based on the output of a predicate Reader filter.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the conditional mutation should be applied. Must not be null.

rowKeyGoogle.Cloud.Bigtable.Common.V2.BigtableByteString

The key of the row to which the conditional mutation should be applied. Must not be empty.

predicateFilterRowFilter

The filter to be applied to the contents of the specified row. Depending on whether or not any results are yielded, either trueMutations or falseMutations will be executed. If null, checks that the row contains any values at all.

trueMutationsIEnumerable<Mutation>

Changes to be atomically applied to the specified row if predicateFilter yields at least one cell when applied to rowKey. Entries are applied in order, meaning that earlier mutations can be masked by later ones. Must contain at least one entry if falseMutations is null or empty, and at most 100000. Can be null or empty, but must not contain null elements.

falseMutationsIEnumerable<Mutation>

Changes to be atomically applied to the specified row if predicateFilter does not yield any cells when applied to rowKey. Entries are applied in order, meaning that earlier mutations can be masked by later ones. Must contain at least one entry if trueMutations is null or empty, and at most 100000. Can be null or empty, but must not contain null elements.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<CheckAndMutateRowResponse>

The response from trying to mutate the row.

Remarks

Note that string is implicitly convertible to Google.Cloud.Bigtable.Common.V2.BigtableByteString, so rowKey can be specified using a string as well and its UTF-8 representations will be used.

This method simply delegates to CheckAndMutateRowAsync(CheckAndMutateRowRequest, CallSettings).

CheckAndMutateRowAsync(CheckAndMutateRowRequest, CallSettings)

public virtual Task<CheckAndMutateRowResponse> CheckAndMutateRowAsync(CheckAndMutateRowRequest request, CallSettings callSettings = null)

Mutates a row atomically based on the output of a predicate Reader filter.

Parameters
NameDescription
requestCheckAndMutateRowRequest

The request object containing all of the parameters for the API call. If the AppProfileId has not been specified, it will be initialized from the value stored in the client.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<CheckAndMutateRowResponse>

A Task containing the RPC response.

CheckAndMutateRowAsync(CheckAndMutateRowRequest, CancellationToken)

public virtual Task<CheckAndMutateRowResponse> CheckAndMutateRowAsync(CheckAndMutateRowRequest request, CancellationToken cancellationToken)

Mutates a row atomically based on the output of a predicate Reader filter.

Parameters
NameDescription
requestCheckAndMutateRowRequest

The request object containing all of the parameters for the API call. If the AppProfileId has not been specified, it will be initialized from the value stored in the client.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<CheckAndMutateRowResponse>

A Task containing the RPC response.

Create()

public static BigtableClient Create()

Synchronously creates a BigtableClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use BigtableClientBuilder.

Returns
TypeDescription
BigtableClient

The created BigtableServiceApiClient.

Create(BigtableServiceApiClient)

public static BigtableClient Create(BigtableServiceApiClient client)

Synchronously creates a BigtableClient from a pre-existing API client.

Parameter
NameDescription
clientBigtableServiceApiClient

The BigtableServiceApiClient to use in the BigtableClient. Must not be null.

Returns
TypeDescription
BigtableClient

The created BigtableClient.

CreateAsync()

public static Task<BigtableClient> CreateAsync()

Asynchronously creates a BigtableClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use BigtableClientBuilder.

Returns
TypeDescription
Task<BigtableClient>

The created BigtableServiceApiClient.

MutateRow(TableName, BigtableByteString, Mutation[])

public virtual MutateRowResponse MutateRow(TableName tableName, BigtableByteString rowKey, params Mutation[] mutations)

Mutates a row atomically. Cells already present in the row are left unchanged unless explicitly changed by mutations.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the mutation should be applied. Must not be null.

rowKeyGoogle.Cloud.Bigtable.Common.V2.BigtableByteString

The key of the row to which the mutation should be applied. Must not be empty.

mutationsMutation[]

Changes to be atomically applied to the specified row. Entries are applied in order, meaning that earlier mutations can be masked by later ones. Must contain at least one entry and at most 100000. Must not be null, or contain null elements.

Returns
TypeDescription
MutateRowResponse

The response from mutating the row.

Remarks

Note that string is implicitly convertible to Google.Cloud.Bigtable.Common.V2.BigtableByteString, so rowKey can be specified using a string as well and its UTF-8 representations will be used.

This method simply delegates to MutateRow(MutateRowRequest, CallSettings).

MutateRow(TableName, BigtableByteString, IEnumerable<Mutation>, CallSettings)

public virtual MutateRowResponse MutateRow(TableName tableName, BigtableByteString rowKey, IEnumerable<Mutation> mutations, CallSettings callSettings = null)

Mutates a row atomically. Cells already present in the row are left unchanged unless explicitly changed by mutations.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the mutation should be applied. Must not be null.

rowKeyGoogle.Cloud.Bigtable.Common.V2.BigtableByteString

The key of the row to which the mutation should be applied. Must not be empty.

mutationsIEnumerable<Mutation>

Changes to be atomically applied to the specified row. Entries are applied in order, meaning that earlier mutations can be masked by later ones. Must contain at least one entry and at most 100000. Must not be null, or contain null elements.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
MutateRowResponse

The response from mutating the row.

Remarks

Note that string is implicitly convertible to Google.Cloud.Bigtable.Common.V2.BigtableByteString, so rowKey can be specified using a string as well and its UTF-8 representations will be used.

This method simply delegates to MutateRow(MutateRowRequest, CallSettings).

MutateRow(MutateRowRequest, CallSettings)

public virtual MutateRowResponse MutateRow(MutateRowRequest request, CallSettings callSettings = null)

Mutates a row atomically. Cells already present in the row are left unchanged unless explicitly changed by mutation.

Parameters
NameDescription
requestMutateRowRequest

The request object containing all of the parameters for the API call. If the AppProfileId has not been specified, it will be initialized from the value stored in the client.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
MutateRowResponse

The RPC response.

MutateRowAsync(TableName, BigtableByteString, Mutation[])

public virtual Task<MutateRowResponse> MutateRowAsync(TableName tableName, BigtableByteString rowKey, params Mutation[] mutations)

Asynchronously mutates a row atomically. Cells already present in the row are left unchanged unless explicitly changed by mutations.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the mutation should be applied. Must not be null.

rowKeyGoogle.Cloud.Bigtable.Common.V2.BigtableByteString

The key of the row to which the mutation should be applied. Must not be empty.

mutationsMutation[]

Changes to be atomically applied to the specified row. Entries are applied in order, meaning that earlier mutations can be masked by later ones. Must contain at least one entry and at most 100000. Must not be null, or contain null elements.

Returns
TypeDescription
Task<MutateRowResponse>

The response from mutating the row.

Remarks

Note that string is implicitly convertible to Google.Cloud.Bigtable.Common.V2.BigtableByteString, so rowKey can be specified using a string as well and its UTF-8 representations will be used.

This method simply delegates to MutateRowAsync(MutateRowRequest, CallSettings).

Example
await client.MutateRowAsync(
    new TableName(projectId, instanceId, tableId),
    // From the row with key '0xABCD1234'...
    new byte[] { 0xAB, 0xCD, 0x12, 0x34 },
    // delete all cells from the column family "Address",
    Mutations.DeleteFromFamily("Address"),
    // and all cells from the "Score:Level 1" column which are older than a day (assuming UTC
    // timestamp micros have been used as version values in this column).
    Mutations.DeleteFromColumn(
        "Score",
        "Level 1",
        new BigtableVersionRange(null, DateTime.UtcNow.AddDays(-1))));

MutateRowAsync(TableName, BigtableByteString, IEnumerable<Mutation>, CallSettings)

public virtual Task<MutateRowResponse> MutateRowAsync(TableName tableName, BigtableByteString rowKey, IEnumerable<Mutation> mutations, CallSettings callSettings = null)

Asynchronously mutates a row atomically. Cells already present in the row are left unchanged unless explicitly changed by mutations.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the mutation should be applied. Must not be null.

rowKeyGoogle.Cloud.Bigtable.Common.V2.BigtableByteString

The key of the row to which the mutation should be applied. Must not be empty.

mutationsIEnumerable<Mutation>

Changes to be atomically applied to the specified row. Entries are applied in order, meaning that earlier mutations can be masked by later ones. Must contain at least one entry and at most 100000. Must not be null, or contain null elements.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<MutateRowResponse>

The response from mutating the row.

Remarks

Note that string is implicitly convertible to Google.Cloud.Bigtable.Common.V2.BigtableByteString, so rowKey can be specified using a string as well and its UTF-8 representations will be used.

This method simply delegates to MutateRowAsync(MutateRowRequest, CallSettings).

MutateRowAsync(MutateRowRequest, CallSettings)

public virtual Task<MutateRowResponse> MutateRowAsync(MutateRowRequest request, CallSettings callSettings = null)

Mutates a row atomically. Cells already present in the row are left unchanged unless explicitly changed by mutation.

Parameters
NameDescription
requestMutateRowRequest

The request object containing all of the parameters for the API call. If the AppProfileId has not been specified, it will be initialized from the value stored in the client.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<MutateRowResponse>

A Task containing the RPC response.

MutateRowAsync(MutateRowRequest, CancellationToken)

public virtual Task<MutateRowResponse> MutateRowAsync(MutateRowRequest request, CancellationToken cancellationToken)

Mutates a row atomically. Cells already present in the row are left unchanged unless explicitly changed by mutation.

Parameters
NameDescription
requestMutateRowRequest

The request object containing all of the parameters for the API call. If the AppProfileId has not been specified, it will be initialized from the value stored in the client.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<MutateRowResponse>

A Task containing the RPC response.

MutateRows(TableName, MutateRowsRequest.Types.Entry[])

public virtual MutateRowsResponse MutateRows(TableName tableName, params MutateRowsRequest.Types.Entry[] entries)

Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow(MutateRowRequest, CallSettings), but the entire batch is not executed atomically.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the mutations should be applied. Must not be null.

entriesMutateRowsRequest.Types.Entry[]

The row keys and corresponding mutations to be applied in bulk. Each entry is applied as an atomic mutation, but the entries may be applied in arbitrary order (even between entries for the same row). At least one entry must be specified, and in total the entries can contain at most 100000 mutations.

Returns
TypeDescription
MutateRowsResponse

The response from mutating the rows.

Remarks

MutateRows(TableName, IEnumerable<MutateRowsRequest.Types.Entry>, CallSettings)

public virtual MutateRowsResponse MutateRows(TableName tableName, IEnumerable<MutateRowsRequest.Types.Entry> entries, CallSettings callSettings = null)

Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow(MutateRowRequest, CallSettings), but the entire batch is not executed atomically.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the mutations should be applied. Must not be null.

entriesIEnumerable<MutateRowsRequest.Types.Entry>

The row keys and corresponding mutations to be applied in bulk. Each entry is applied as an atomic mutation, but the entries may be applied in arbitrary order (even between entries for the same row). At least one entry must be specified, and in total the entries can contain at most 100000 mutations. Must not be null, or contain null elements.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
MutateRowsResponse

The response from mutating the rows.

Remarks

This method simply delegates to MutateRows(MutateRowsRequest, CallSettings).

MutateRows(MutateRowsRequest, CallSettings)

public virtual MutateRowsResponse MutateRows(MutateRowsRequest request, CallSettings callSettings = null)

Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow, but the entire batch is not executed atomically.

Parameters
NameDescription
requestMutateRowsRequest

The request object containing all of the parameters for the API call. If the AppProfileId has not been specified, it will be initialized from the value stored in the client.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
MutateRowsResponse

The RPC response.

MutateRowsAsync(TableName, MutateRowsRequest.Types.Entry[])

public virtual Task<MutateRowsResponse> MutateRowsAsync(TableName tableName, params MutateRowsRequest.Types.Entry[] entries)

Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow(MutateRowRequest, CallSettings), but the entire batch is not executed atomically.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the mutations should be applied. Must not be null.

entriesMutateRowsRequest.Types.Entry[]

The row keys and corresponding mutations to be applied in bulk. Each entry is applied as an atomic mutation, but the entries may be applied in arbitrary order (even between entries for the same row). At least one entry must be specified, and in total the entries can contain at most 100000 mutations.

Returns
TypeDescription
Task<MutateRowsResponse>

The response from mutating the rows.

Remarks Example
MutateRowsResponse response = await client.MutateRowsAsync(
    new TableName(projectId, instanceId, tableId),
    // From row 'user12345'...
    Mutations.CreateEntry("user12345",
        // delete all cells from the column family "Score",
        Mutations.DeleteFromFamily("Score"),
        // and all cells from the "metrics:clicks" column which are older than a day (assuming UTC
        // timestamp micros have been used as version values in this column).
        Mutations.DeleteFromColumn(
            "metrics",
            "clicks",
            new BigtableVersionRange(null, DateTime.UtcNow.AddDays(-1)))),
    // Delete all data from row 'user23456'
    Mutations.CreateEntry("user23456", Mutations.DeleteFromRow()));

foreach (MutateRowsResponse.Types.Entry entry in response.Entries)
{
    switch (entry.Index)
    {
        case 0:
            Console.WriteLine($"The mutations to row 'user12345' finished with status code {entry.Status.Code}");
            break;
        case 1:
            Console.WriteLine($"The mutations to row 'user23456' finished with status code {entry.Status.Code}");
            break;
        default:
            throw new ArgumentOutOfRangeException();
    }
}

MutateRowsAsync(TableName, IEnumerable<MutateRowsRequest.Types.Entry>, CallSettings)

public virtual Task<MutateRowsResponse> MutateRowsAsync(TableName tableName, IEnumerable<MutateRowsRequest.Types.Entry> entries, CallSettings callSettings = null)

Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow(MutateRowRequest, CallSettings), but the entire batch is not executed atomically.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the mutations should be applied. Must not be null.

entriesIEnumerable<MutateRowsRequest.Types.Entry>

The row keys and corresponding mutations to be applied in bulk. Each entry is applied as an atomic mutation, but the entries may be applied in arbitrary order (even between entries for the same row). At least one entry must be specified, and in total the entries can contain at most 100000 mutations. Must not be null, or contain null elements.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<MutateRowsResponse>

The response from mutating the rows.

Remarks

This method simply delegates to MutateRowsAsync(MutateRowsRequest, CallSettings).

MutateRowsAsync(MutateRowsRequest, CallSettings)

public virtual Task<MutateRowsResponse> MutateRowsAsync(MutateRowsRequest request, CallSettings callSettings = null)

Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow, but the entire batch is not executed atomically.

Parameters
NameDescription
requestMutateRowsRequest

The request object containing all of the parameters for the API call. If the AppProfileId has not been specified, it will be initialized from the value stored in the client.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<MutateRowsResponse>

The RPC response.

MutateRowsAsync(MutateRowsRequest, CancellationToken)

public virtual Task<MutateRowsResponse> MutateRowsAsync(MutateRowsRequest request, CancellationToken cancellationToken)

Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow, but the entire batch is not executed atomically.

Parameters
NameDescription
requestMutateRowsRequest

The request object containing all of the parameters for the API call. If the AppProfileId has not been specified, it will be initialized from the value stored in the client.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<MutateRowsResponse>

The RPC response.

ReadModifyWriteRow(TableName, BigtableByteString, ReadModifyWriteRule[])

public virtual ReadModifyWriteRowResponse ReadModifyWriteRow(TableName tableName, BigtableByteString rowKey, params ReadModifyWriteRule[] rules)

Modifies a row atomically on the server. The method reads the latest existing version and value from the specified columns and writes a new entry based on pre-defined read/modify/write rules. The new value for the version is the greater of the previous value's version or the current server version. The method returns the new contents of all modified cells.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the read/modify/write rules should be applied. Must not be null.

rowKeyGoogle.Cloud.Bigtable.Common.V2.BigtableByteString

The key of the row to which the read/modify/write rules should be applied. Must not be empty.

rulesReadModifyWriteRule[]

Rules specifying how the specified row's contents are to be transformed into writes. Entries are applied in order, meaning that earlier rules will affect the results of later ones. Must not be null, or contain null elements.

Returns
TypeDescription
ReadModifyWriteRowResponse

The response from modifying the row.

Remarks

Note that the server version is based on the current timestamp since the Unix epoch, so for columns which are updated using ReadModifyWriteRow, other reads and writes of those columns should use BigtableVersion values constructed from DateTime values, as opposed to using a custom versioning scheme with 64-bit values.

Note that string is implicitly convertible to Google.Cloud.Bigtable.Common.V2.BigtableByteString, so rowKey can be specified using a string as well and its UTF-8 representations will be used.

This method simply delegates to ReadModifyWriteRow(ReadModifyWriteRowRequest, CallSettings).

ReadModifyWriteRow(TableName, BigtableByteString, IEnumerable<ReadModifyWriteRule>, CallSettings)

public virtual ReadModifyWriteRowResponse ReadModifyWriteRow(TableName tableName, BigtableByteString rowKey, IEnumerable<ReadModifyWriteRule> rules, CallSettings callSettings = null)

Modifies a row atomically on the server. The method reads the latest existing version and value from the specified columns and writes a new entry based on pre-defined read/modify/write rules. The new value for the version is the greater of the previous value's version or the current server version. The method returns the new contents of all modified cells.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the read/modify/write rules should be applied. Must not be null.

rowKeyGoogle.Cloud.Bigtable.Common.V2.BigtableByteString

The key of the row to which the read/modify/write rules should be applied. Must not be empty.

rulesIEnumerable<ReadModifyWriteRule>

Rules specifying how the specified row's contents are to be transformed into writes. Entries are applied in order, meaning that earlier rules will affect the results of later ones. Must not be null, or contain null elements.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReadModifyWriteRowResponse

The response from modifying the row.

Remarks

Note that the server version is based on the current timestamp since the Unix epoch, so for columns which are updated using ReadModifyWriteRow, other reads and writes of those columns should use BigtableVersion values constructed from DateTime values, as opposed to using a custom versioning scheme with 64-bit values.

Note that string is implicitly convertible to Google.Cloud.Bigtable.Common.V2.BigtableByteString, so rowKey can be specified using a string as well and its UTF-8 representations will be used.

This method simply delegates to ReadModifyWriteRow(ReadModifyWriteRowRequest, CallSettings).

ReadModifyWriteRow(ReadModifyWriteRowRequest, CallSettings)

public virtual ReadModifyWriteRowResponse ReadModifyWriteRow(ReadModifyWriteRowRequest request, CallSettings callSettings = null)

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
NameDescription
requestReadModifyWriteRowRequest

The request object containing all of the parameters for the API call. If the AppProfileId has not been specified, it will be initialized from the value stored in the client.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReadModifyWriteRowResponse

The RPC response.

ReadModifyWriteRowAsync(TableName, BigtableByteString, ReadModifyWriteRule[])

public virtual Task<ReadModifyWriteRowResponse> ReadModifyWriteRowAsync(TableName tableName, BigtableByteString rowKey, params ReadModifyWriteRule[] rules)

Asynchronously modifies a row atomically on the server. The method reads the latest existing version and value from the specified columns and writes a new entry based on pre-defined read/modify/write rules. The new value for the version is the greater of the previous value's version or the current server version. The method returns the new contents of all modified cells.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the read/modify/write rules should be applied. Must not be null.

rowKeyGoogle.Cloud.Bigtable.Common.V2.BigtableByteString

The key of the row to which the read/modify/write rules should be applied. Must not be empty.

rulesReadModifyWriteRule[]

Rules specifying how the specified row's contents are to be transformed into writes. Entries are applied in order, meaning that earlier rules will affect the results of later ones. Must not be null, or contain null elements.

Returns
TypeDescription
Task<ReadModifyWriteRowResponse>

The response from modifying the row.

Remarks

Note that the server version is based on the current timestamp since the Unix epoch, so for columns which are updated using ReadModifyWriteRow, other reads and writes of those columns should use BigtableVersion values constructed from DateTime values, as opposed to using a custom versioning scheme with 64-bit values.

Note that string is implicitly convertible to Google.Cloud.Bigtable.Common.V2.BigtableByteString, so rowKey can be specified using a string as well and its UTF-8 representations will be used.

This method simply delegates to ReadModifyWriteRowAsync(ReadModifyWriteRowRequest, CallSettings).

Example
// Increase the value of the cell with the "Level 1" qualifier in the
// "Score" column family by 55.
ReadModifyWriteRowResponse response = await client.ReadModifyWriteRowAsync(
    new TableName(projectId, instanceId, tableId),
    "user12345",
    ReadModifyWriteRules.Increment("Score", "Level 1", 55));

Cell modifiedCell = response.Row.Families[0].Columns[0].Cells[0];

// Implicitly convert the ByteString Value into a BigtableByteString,
// which supports additional conversions specific to Bigtable.
BigtableByteString value = modifiedCell.Value;

// Convert the BigtableByteString to a long to obtain the updated value.
long newScore = (long) value;
Console.WriteLine($"The total score for level 1 is now {newScore}");

ReadModifyWriteRowAsync(TableName, BigtableByteString, IEnumerable<ReadModifyWriteRule>, CallSettings)

public virtual Task<ReadModifyWriteRowResponse> ReadModifyWriteRowAsync(TableName tableName, BigtableByteString rowKey, IEnumerable<ReadModifyWriteRule> rules, CallSettings callSettings = null)

Asynchronously modifies a row atomically on the server. The method reads the latest existing version and value from the specified columns and writes a new entry based on pre-defined read/modify/write rules. The new value for the version is the greater of the previous value's version or the current server version. The method returns the new contents of all modified cells.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table to which the read/modify/write rules should be applied. Must not be null.

rowKeyGoogle.Cloud.Bigtable.Common.V2.BigtableByteString

The key of the row to which the read/modify/write rules should be applied. Must not be empty.

rulesIEnumerable<ReadModifyWriteRule>

Rules specifying how the specified row's contents are to be transformed into writes. Entries are applied in order, meaning that earlier rules will affect the results of later ones. Must not be null, or contain null elements.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ReadModifyWriteRowResponse>

The response from modifying the row.

Remarks

Note that the server version is based on the current timestamp since the Unix epoch, so for columns which are updated using ReadModifyWriteRow, other reads and writes of those columns should use BigtableVersion values constructed from DateTime values, as opposed to using a custom versioning scheme with 64-bit values.

Note that string is implicitly convertible to Google.Cloud.Bigtable.Common.V2.BigtableByteString, so rowKey can be specified using a string as well and its UTF-8 representations will be used.

This method simply delegates to ReadModifyWriteRowAsync(ReadModifyWriteRowRequest, CallSettings).

ReadModifyWriteRowAsync(ReadModifyWriteRowRequest, CallSettings)

public virtual Task<ReadModifyWriteRowResponse> ReadModifyWriteRowAsync(ReadModifyWriteRowRequest request, CallSettings callSettings = null)

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
NameDescription
requestReadModifyWriteRowRequest

The request object containing all of the parameters for the API call. If the AppProfileId has not been specified, it will be initialized from the value stored in the client.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ReadModifyWriteRowResponse>

A Task containing the RPC response.

ReadModifyWriteRowAsync(ReadModifyWriteRowRequest, CancellationToken)

public virtual Task<ReadModifyWriteRowResponse> ReadModifyWriteRowAsync(ReadModifyWriteRowRequest request, CancellationToken cancellationToken)

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
NameDescription
requestReadModifyWriteRowRequest

The request object containing all of the parameters for the API call. If the AppProfileId has not been specified, it will be initialized from the value stored in the client.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ReadModifyWriteRowResponse>

A Task containing the RPC response.

ReadRow(TableName, BigtableByteString, RowFilter, CallSettings)

public virtual Row ReadRow(TableName tableName, BigtableByteString rowKey, RowFilter filter = null, CallSettings callSettings = null)

Returns the contents of the requested row, optionally applying the specified Reader filter.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table from which to read. Must not be null.

rowKeyGoogle.Cloud.Bigtable.Common.V2.BigtableByteString

The key of the row to read. Must not be empty.

filterRowFilter

The filter to apply to the contents of the specified row. If null, reads the entirety of the row.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Row

The row from the server or null if it does not exist.

Remarks

ReadRowAsync(TableName, BigtableByteString, RowFilter, CallSettings)

public virtual Task<Row> ReadRowAsync(TableName tableName, BigtableByteString rowKey, RowFilter filter = null, CallSettings callSettings = null)

Asynchronously returns the contents of the requested row, optionally applying the specified Reader filter.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table from which to read. Must not be null.

rowKeyGoogle.Cloud.Bigtable.Common.V2.BigtableByteString

The key of the row to read. Must not be empty.

filterRowFilter

The filter to apply to the contents of the specified row. If null, reads the entirety of the row.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Row>

The row from the server or null if it does not exist.

Remarks

This method simply delegates to ReadRows(TableName, RowSet, RowFilter, Nullable<Int64>, CallSettings) and takes the single row result or null if no rows are returned.

Example
// Only read cells from the "Line X" columns, where X is some
// digit, in the Address column family and only take the most
// recent cell from each column.
Row row = await client.ReadRowAsync(
    new TableName(projectId, instanceId, tableId),
    "user12345",
    RowFilters.Chain(
        RowFilters.FamilyNameExact("Address"),
        RowFilters.ColumnQualifierRegex(@"Line \d"),
        RowFilters.CellsPerColumnLimit(1)),
    CallSettings.FromCancellationToken(cancellationToken));

Family addressFamily = row.Families.FirstOrDefault();
if (addressFamily != null)
{
    foreach (Column column in addressFamily.Columns)
    {
        Console.WriteLine($"    Column qualifier: {column.Qualifier.ToStringUtf8()}");
        foreach (Cell cell in column.Cells)
        {
            Console.WriteLine($"      Cell value: {cell.Value.ToStringUtf8()}");
            Console.WriteLine($"      Timestamp: {cell.Version.ToDateTime()}");
            Console.WriteLine($"      Labels: {string.Join(", ", cell.Labels)}");
        }
    }
}

ReadRows(TableName, RowSet, RowFilter, Nullable<Int64>, CallSettings)

public virtual ReadRowsStream ReadRows(TableName tableName, RowSet rows = null, RowFilter filter = null, long? rowsLimit = default(long? ), CallSettings callSettings = null)

Streams back the contents of all requested rows in key order, optionally applying the same Reader filter to each.

Parameters
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

The unique name of the table from which to read. Must not be null.

rowsRowSet

The row keys and/or ranges to read. If null, reads from all rows.

filterRowFilter

The filter to apply to the contents of the specified row(s). If null, reads the entirety of each row.

rowsLimitNullable<Int64>

The read will terminate after committing to N rows' worth of results. If null or 0, returns all results.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReadRowsStream

The server stream.

Remarks

This method simply delegates to ReadRows(ReadRowsRequest, CallSettings).

Example
TableName tableName = new TableName(projectId, instanceId, tableId);

// Read rows whose keys are greater than or equal to 'user00000'
// and less than 'user99999'.
RowSet rows = RowSet.FromRowRanges(
    RowRange.ClosedOpen("user00000", "user99999"));

// Only read cells from the "Address" column family and only take the most recent cell from each column.
RowFilter filter = RowFilters.Chain(
    RowFilters.FamilyNameExact("Address"),
    RowFilters.CellsPerColumnLimit(1));

// Just read the first 10 rows.
long rowsLimit = 10;

// Make the request
ReadRowsStream streamingResponse = client.ReadRows(
    tableName,
    rows,
    filter,
    rowsLimit,
    CallSettings.FromCancellationToken(cancellationToken));

// Read streaming responses from server until complete
await streamingResponse.ForEachAsync(row =>
{
    Console.WriteLine($"Row key: {row.Key.ToStringUtf8()}");
    foreach (Family family in row.Families)
    {
        Console.WriteLine($"  Family name: {family.Name}");
        foreach (Column column in family.Columns)
        {
            Console.WriteLine($"    Column qualifier: {column.Qualifier.ToStringUtf8()}");
            foreach (Cell cell in column.Cells)
            {
                Console.WriteLine($"      Cell value: {cell.Value.ToStringUtf8()}");
                Console.WriteLine($"      Timestamp: {cell.Version.ToDateTime()}");
                Console.WriteLine($"      Labels: {string.Join(", ", cell.Labels)}");
            }
        }
    }
});

ReadRows(ReadRowsRequest, CallSettings)

public virtual ReadRowsStream ReadRows(ReadRowsRequest request, CallSettings callSettings = null)

Streams back the contents of all requested rows in key order, optionally applying the same Reader filter to each.

Parameters
NameDescription
requestReadRowsRequest

The request object containing all of the parameters for the API call. If the AppProfileId has not been specified, it will be initialized from the value stored in the client.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReadRowsStream

The server stream.

SampleRowKeys(TableName, CallSettings)

public virtual BigtableServiceApiClient.SampleRowKeysStream SampleRowKeys(TableName tableName, CallSettings callSettings = null)

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
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

Required. The unique name of the table from which to sample row keys. Values are of the form projects/&amp;lt;project&amp;gt;/instances/&amp;lt;instance&amp;gt;/tables/&amp;lt;table&amp;gt;.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BigtableServiceApiClient.SampleRowKeysStream

The server stream.

Example
BigtableServiceApiClient.SampleRowKeysStream streamingResponse = client.SampleRowKeys(
    new TableName(projectId, instanceId, tableId),
    CallSettings.FromCancellationToken(cancellationToken));

// Get all streaming responses from server in a list so they can be easily iterated.
IList<SampleRowKeysResponse> rowKeySamples =
    await streamingResponse.ToListAsync(cancellationToken);

long previousRowOffsetBytes = 0;
foreach (SampleRowKeysResponse rowKeySample in rowKeySamples)
{
    // The OffsetBytes are non-decreasing, so their difference should always be 0 or more.
    long offsetDifference = rowKeySample.OffsetBytes - previousRowOffsetBytes;

    Console.WriteLine($"Row key: {rowKeySample.RowKey.ToStringUtf8()}, at offset {rowKeySample.OffsetBytes}");
    Console.WriteLine($"  Approximate bytes since previous row sample: {offsetDifference}");

    previousRowOffsetBytes = rowKeySample.OffsetBytes;
}

SampleRowKeys(TableName, String, CallSettings)

public virtual BigtableServiceApiClient.SampleRowKeysStream SampleRowKeys(TableName tableName, string appProfileId, CallSettings callSettings = null)

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
NameDescription
tableNameGoogle.Cloud.Bigtable.Common.V2.TableName

Required. The unique name of the table from which to sample row keys. Values are of the form projects/&amp;lt;project&amp;gt;/instances/&amp;lt;instance&amp;gt;/tables/&amp;lt;table&amp;gt;.

appProfileIdString

This value specifies routing for replication. If not specified, the "default" application profile will be used.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BigtableServiceApiClient.SampleRowKeysStream

The server stream.

SampleRowKeys(SampleRowKeysRequest, CallSettings)

public virtual BigtableServiceApiClient.SampleRowKeysStream SampleRowKeys(SampleRowKeysRequest request, CallSettings callSettings = null)

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
NameDescription
requestSampleRowKeysRequest

The request object containing all of the parameters for the API call. If the AppProfileId has not been specified, it will be initialized from the value stored in the client.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BigtableServiceApiClient.SampleRowKeysStream

The server stream.

SampleRowKeys(String, CallSettings)

public virtual BigtableServiceApiClient.SampleRowKeysStream SampleRowKeys(string tableName, CallSettings callSettings = null)

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
NameDescription
tableNameString

Required. The unique name of the table from which to sample row keys. Values are of the form projects/&amp;lt;project&amp;gt;/instances/&amp;lt;instance&amp;gt;/tables/&amp;lt;table&amp;gt;.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BigtableServiceApiClient.SampleRowKeysStream

The server stream.

SampleRowKeys(String, String, CallSettings)

public virtual BigtableServiceApiClient.SampleRowKeysStream SampleRowKeys(string tableName, string appProfileId, CallSettings callSettings = null)

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
NameDescription
tableNameString

Required. The unique name of the table from which to sample row keys. Values are of the form projects/&amp;lt;project&amp;gt;/instances/&amp;lt;instance&amp;gt;/tables/&amp;lt;table&amp;gt;.

appProfileIdString

This value specifies routing for replication. If not specified, the "default" application profile will be used.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BigtableServiceApiClient.SampleRowKeysStream

The server stream.