Example #1
0
 internal HelloWorld(HelloWorldSettings settings)
 {
     _settings = settings;
     _bigtableTableAdminClient = BigtableTableAdminClient.Create();
     _bigtableClient           = BigtableClient.Create();
     _tableNameAdmin           = new Google.Cloud.Bigtable.Admin.V2.TableName(_settings.ProjectId, _settings.InstanceId, _settings.TableName);
     _tableNameClient          = new Google.Cloud.Bigtable.V2.TableName(_settings.ProjectId, _settings.InstanceId, _settings.TableName);
 }
Example #2
0
 /// <summary>
 /// Permanently drop/delete all rows in the table.
 /// </summary>
 /// <remarks>
 /// <para>
 /// This method simply delegates to <see cref="DropRowRangeAsync(DropRowRangeRequest, CallSettings)"/>.
 /// </para>
 /// </remarks>
 /// <param name="tableName">
 /// The unique name of the table on which to drop the rows. Must not be null.
 /// </param>
 /// <param name="callSettings">
 /// If not null, applies overrides to this RPC call.
 /// </param>
 /// <returns>
 /// A Task that completes when the RPC has completed.
 /// </returns>
 public Task DropAllRowsAsync(TableName tableName, CallSettings callSettings = null) =>
 DropRowRangeAsync(
Example #3
0
 /// <summary>
 /// Checks if table with a specific <see cref="Google.Cloud.Bigtable.V2.TableName"/> is already exist on the given <see cref="InstanceName"/>
 /// </summary>
 /// <param name="bigtableTableAdminClient"> an instance of <see cref="BigtableTableAdminClient"/></param>
 /// <param name="tableName"> an instance of <see cref="Google.Cloud.Bigtable.Admin.V2.TableName"/> with tableId of the table in question</param>
 private bool DoesTableExist(BigtableTableAdminClient bigtableTableAdminClient, Google.Cloud.Bigtable.Admin.V2.TableName tableName)
 {
     try
     {
         bigtableTableAdminClient.GetTable(tableName);
         return(true);
     }
     catch (Exception ex)
     {
         if (ex.Message.Contains("Table not found"))
         {
             return(false);
         }
         throw;
     }
 }