diff --git a/CHANGELOG.md b/CHANGELOG.md index 54e1097d7836..be666f297db1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,19 @@ ## v1.30.0 - TBD +### Bigtable: + +**BREAKING CHANGES**: +* `Async*` functions in `Table` that took `CompletionQueue&` as a parameter + have been removed. Users that need to update their code should use the + identically named functions which do not require a `CompletionQueue&`. If + users absolutely require a custom `CompletionQueue`, one can be supplied to + the `DataClient` used to construct the `Table`, via + `ClientOptions::DisableBackgroundThreads(CompletionQueue const&)`. + See [#2567][issue-2567] for more details. + +[issue-2567]: https://github.com/googleapis/google-cloud-cpp/issues/2567 + ## v1.29.0 - 2021-07 ### Bigtable: diff --git a/google/cloud/bigtable/table.cc b/google/cloud/bigtable/table.cc index 768cd3719b06..dfb6f905c9cd 100644 --- a/google/cloud/bigtable/table.cc +++ b/google/cloud/bigtable/table.cc @@ -149,10 +149,6 @@ future Table::AsyncApplyImpl(SingleRowMutation mut, }); } -future Table::AsyncApply(SingleRowMutation mut, CompletionQueue& cq) { - return AsyncApplyImpl(std::move(mut), cq); -} - future Table::AsyncApply(SingleRowMutation mut) { auto cq = background_threads_->cq(); return AsyncApplyImpl(std::move(mut), cq); @@ -194,11 +190,6 @@ future> Table::AsyncBulkApplyImpl( app_profile_id_, table_name(), std::move(mut)); } -future> Table::AsyncBulkApply(BulkMutation mut, - CompletionQueue& cq) { - return AsyncBulkApplyImpl(std::move(mut), cq); -} - future> Table::AsyncBulkApply(BulkMutation mut) { auto cq = background_threads_->cq(); return AsyncBulkApplyImpl(std::move(mut), cq); @@ -316,14 +307,6 @@ future> Table::AsyncCheckAndMutateRowImpl( }); } -future> Table::AsyncCheckAndMutateRow( - std::string row_key, Filter filter, std::vector true_mutations, - std::vector false_mutations, CompletionQueue& cq) { - return AsyncCheckAndMutateRowImpl(std::move(row_key), std::move(filter), - std::move(true_mutations), - std::move(false_mutations), cq); -} - future> Table::AsyncCheckAndMutateRow( std::string row_key, Filter filter, std::vector true_mutations, std::vector false_mutations) { @@ -490,12 +473,6 @@ future>> Table::AsyncReadRowImpl( return handler->GetFuture(); } -future>> Table::AsyncReadRow(CompletionQueue& cq, - std::string row_key, - Filter filter) { - return AsyncReadRowImpl(cq, std::move(row_key), std::move(filter)); -} - future>> Table::AsyncReadRow(std::string row_key, Filter filter) { auto cq = background_threads_->cq(); diff --git a/google/cloud/bigtable/table.h b/google/cloud/bigtable/table.h index f99fbf090b80..580efc297e32 100644 --- a/google/cloud/bigtable/table.h +++ b/google/cloud/bigtable/table.h @@ -381,32 +381,6 @@ class Table { */ Status Apply(SingleRowMutation mut); - /** - * Makes asynchronous attempts to apply the mutation to a row. - * - * @warning This is an early version of the asynchronous APIs for Cloud - * Bigtable. These APIs might be changed in backward-incompatible ways. It - * is not subject to any SLA or deprecation policy. - * - * @param mut the mutation. Note that this function takes ownership - * (and then discards) the data in the mutation. In general, a - * `SingleRowMutation` can be used to modify and/or delete - * multiple cells, across different columns and column families. - * @param cq the completion queue that will execute the asynchronous - * calls, the application must ensure that one or more threads are - * blocked on `cq.Run()`. - * - * @par Idempotency - * This operation is idempotent if the provided mutations are idempotent. Note - * that `google::cloud::bigtable::SetCell()` without an explicit timestamp is - * **not** an idempotent operation. - * - * @par Example - * @snippet data_async_snippets.cc async-apply - */ - GOOGLE_CLOUD_CPP_BIGTABLE_ASYNC_CQ_PARAM_DEPRECATED - future AsyncApply(SingleRowMutation mut, CompletionQueue& cq); - /** * Makes asynchronous attempts to apply the mutation to a row. * @@ -453,39 +427,6 @@ class Table { */ std::vector BulkApply(BulkMutation mut); - /** - * Makes asynchronous attempts to apply mutations to multiple rows. - * - * @warning This is an early version of the asynchronous APIs for Cloud - * Bigtable. These APIs might be changed in backward-incompatible ways. It - * is not subject to any SLA or deprecation policy. - * - * @param mut the mutations, note that this function takes - * ownership (and then discards) the data in the mutation. In general, a - * `BulkMutation` can modify multiple rows, and the modifications for each - * row can change (or create) multiple cells, across different columns and - * column families. - * @param cq the completion queue that will execute the asynchronous calls, - * the application must ensure that one or more threads are blocked on - * `cq.Run()`. - * - * @par Idempotency - * This operation is idempotent if the provided mutations are idempotent. Note - * that `google::cloud::bigtable::SetCell()` without an explicit timestamp is - * **not** an idempotent operation. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet data_async_snippets.cc bulk async-bulk-apply - */ - GOOGLE_CLOUD_CPP_BIGTABLE_ASYNC_CQ_PARAM_DEPRECATED - future> AsyncBulkApply(BulkMutation mut, - CompletionQueue& cq); - /** * Makes asynchronous attempts to apply mutations to multiple rows. * @@ -615,41 +556,6 @@ class Table { std::string row_key, Filter filter, std::vector true_mutations, std::vector false_mutations); - /** - * Make an asynchronous request to conditionally mutate a row. - * - * @warning This is an early version of the asynchronous APIs for Cloud - * Bigtable. These APIs might be changed in backward-incompatible ways. It - * is not subject to any SLA or deprecation policy. - * - * @param row_key the row key on which the conditional mutation will be - * performed - * @param filter the condition, depending on which the mutation will be - * performed - * @param true_mutations the mutations which will be performed if @p filter is - * true - * @param false_mutations the mutations which will be performed if @p filter - * is false - * @param cq the completion queue that will execute the asynchronous calls, - * the application must ensure that one or more threads are blocked on - * `cq.Run()`. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet data_async_snippets.cc async check and mutate - */ - GOOGLE_CLOUD_CPP_BIGTABLE_ASYNC_CQ_PARAM_DEPRECATED - future> AsyncCheckAndMutateRow( - std::string row_key, Filter filter, std::vector true_mutations, - std::vector false_mutations, CompletionQueue& cq); - /** * Make an asynchronous request to conditionally mutate a row. * @@ -773,46 +679,6 @@ class Table { return ReadModifyWriteRowImpl(std::move(request)); } - /** - * Make an asynchronous request to atomically read and modify a row. - * - * @warning This is an early version of the asynchronous APIs for Cloud - * Bigtable. These APIs might be changed in backward-incompatible ways. It - * is not subject to any SLA or deprecation policy. - * - * @param row_key the row key on which modification will be performed - * @param cq the completion queue that will execute the asynchronous calls, - * the application must ensure that one or more threads are blocked on - * `cq.Run()`. - * - * @param rule to modify the row. Two types of rules are applied here - * AppendValue which will read the existing value and append the - * text provided to the value. - * IncrementAmount which will read the existing uint64 big-endian-int - * and add the value provided. - * Both rules accept the family and column identifier to modify. - * @param rules is the zero or more ReadModifyWriteRules to apply on a row. - * @returns A future, that becomes satisfied when the operation completes, - * at that point the future has the contents of all modified cells. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. - * - * @par Example - * @snippet data_async_snippets.cc async read modify write - */ - template - GOOGLE_CLOUD_CPP_BIGTABLE_ASYNC_CQ_PARAM_DEPRECATED future> - AsyncReadModifyWriteRow(std::string row_key, CompletionQueue& cq, - bigtable::ReadModifyWriteRule rule, Args&&... rules) { - return AsyncReadModifyWriteRowImpl(std::move(row_key), cq, std::move(rule), - std::forward(rules)...); - } - /** * Make an asynchronous request to atomically read and modify a row. * @@ -851,47 +717,6 @@ class Table { std::forward(rules)...); } - /** - * Asynchronously reads a set of rows from the table. - * - * @warning This is an early version of the asynchronous APIs for Cloud - * Bigtable. These APIs might be changed in backward-incompatible ways. It - * is not subject to any SLA or deprecation policy. - * - * @param cq the completion queue that will execute the asynchronous calls, - * the application must ensure that one or more threads are blocked on - * `cq.Run()`. - * @param on_row the callback to be invoked on each successfully read row; it - * should be invocable with `Row` and return a future; the returned - * `future` should be satisfied with `true` when the user is ready - * to receive the next callback and with `false` when the user doesn't - * want any more rows; if `on_row` throws, the results are undefined - * @param on_finish the callback to be invoked when the stream is closed; it - * should be invocable with `Status` and not return anything; it will - * always be called as the last callback; if `on_finish` throws, the - * results are undefined - * @param row_set the rows to read from. - * @param filter is applied on the server-side to data in the rows. - * - * @tparam RowFunctor the type of the @p on_row callback. - * @tparam FinishFunctor the type of the @p on_finish callback. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet data_async_snippets.cc async read rows - */ - template - GOOGLE_CLOUD_CPP_BIGTABLE_ASYNC_CQ_PARAM_DEPRECATED void AsyncReadRows( - CompletionQueue& cq, RowFunctor on_row, FinishFunctor on_finish, - RowSet row_set, Filter filter) { - return AsyncReadRowsImpl(cq, std::move(on_row), std::move(on_finish), - std::move(row_set), std::move(filter)); - } - /** * Asynchronously reads a set of rows from the table. * @@ -930,52 +755,6 @@ class Table { std::move(row_set), std::move(filter)); } - /** - * Asynchronously reads a set of rows from the table. - * - * @warning This is an early version of the asynchronous APIs for Cloud - * Bigtable. These APIs might be changed in backward-incompatible ways. It - * is not subject to any SLA or deprecation policy. - * - * @param cq the completion queue that will execute the asynchronous calls, - * the application must ensure that one or more threads are blocked on - * `cq.Run()`. - * @param on_row the callback to be invoked on each successfully read row; it - * should be invocable with `Row` and return a future; the returned - * `future` should be satisfied with `true` when the user is ready - * to receive the next callback and with `false` when the user doesn't - * want any more rows; if `on_row` throws, the results are undefined - * @param on_finish the callback to be invoked when the stream is closed; it - * should be invocable with `Status` and not return anything; it will - * always be called as the last callback; if `on_finish` throws, the - * results are undefined - * @param row_set the rows to read from. - * @param rows_limit the maximum number of rows to read. Cannot be a negative - * number or zero. Use `AsyncReadRows(CompletionQueue, RowSet, Filter)` to - * read all matching rows. - * @param filter is applied on the server-side to data in the rows. - * - * @tparam RowFunctor the type of the @p on_row callback. - * @tparam FinishFunctor the type of the @p on_finish callback. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. The callbacks passed to this - * function may be executed on any thread running the provided completion - * queue. - * - * @par Example - * @snippet data_async_snippets.cc async read rows with limit - */ - template - GOOGLE_CLOUD_CPP_BIGTABLE_ASYNC_CQ_PARAM_DEPRECATED void AsyncReadRows( - CompletionQueue& cq, RowFunctor on_row, FinishFunctor on_finish, - RowSet row_set, std::int64_t rows_limit, Filter filter) { - AsyncReadRowsImpl(cq, std::move(on_row), std::move(on_finish), - std::move(row_set), rows_limit, std::move(filter)); - } - /** * Asynchronously reads a set of rows from the table. * @@ -1019,43 +798,6 @@ class Table { std::move(row_set), rows_limit, std::move(filter)); } - /** - * Asynchronously read and return a single row from the table. - * - * @warning This is an early version of the asynchronous APIs for Cloud - * Bigtable. These APIs might be changed in backward-incompatible ways. It - * is not subject to any SLA or deprecation policy. - * - * @param cq the completion queue that will execute the asynchronous calls, - * the application must ensure that one or more threads are blocked on - * `cq.Run()`. - * @param row_key the row to read. - * @param filter a filter expression, can be used to select a subset of the - * column families and columns in the row. - * @returns a future satisfied when the operation completes, fails - * permanently or keeps failing transiently, but the retry policy has been - * exhausted. The future will return a tuple. The first element is a - * boolean, with value `false` if the row does not exist. If the first - * element is `true` the second element has the contents of the Row. Note - * that the contents may be empty if the filter expression removes all - * column families and columns. - * - * @par Idempotency - * This is a read-only operation and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet data_async_snippets.cc async read row - */ - GOOGLE_CLOUD_CPP_BIGTABLE_ASYNC_CQ_PARAM_DEPRECATED - future>> AsyncReadRow(CompletionQueue& cq, - std::string row_key, - Filter filter); - /** * Asynchronously read and return a single row from the table. * diff --git a/google/cloud/bigtable/version.h b/google/cloud/bigtable/version.h index f624a55cbdd0..2659e5bac53b 100644 --- a/google/cloud/bigtable/version.h +++ b/google/cloud/bigtable/version.h @@ -27,12 +27,6 @@ " instead. The function will be removed on 2022-04-01 or shortly " \ "after. See GitHub issue #5929 for more information.") -#define GOOGLE_CLOUD_CPP_BIGTABLE_ASYNC_CQ_PARAM_DEPRECATED \ - GOOGLE_CLOUD_CPP_DEPRECATED( \ - "this experimental function will be removed on or shortly after " \ - "2021-07-01. See GitHub issue #2567 for more information. Please use " \ - "an overload without the cq parameter.") - #define BIGTABLE_CLIENT_NS \ GOOGLE_CLOUD_CPP_VEVAL(BIGTABLE_CLIENT_VERSION_MAJOR, \ BIGTABLE_CLIENT_VERSION_MINOR)