Skip to content

Commit

Permalink
cleanup(bigtable): remove async functions that take cq as a param
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolduc committed Jul 1, 2021
1 parent 5db7a8c commit 6b2d219
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 287 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
23 changes: 0 additions & 23 deletions google/cloud/bigtable/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,6 @@ future<Status> Table::AsyncApplyImpl(SingleRowMutation mut,
});
}

future<Status> Table::AsyncApply(SingleRowMutation mut, CompletionQueue& cq) {
return AsyncApplyImpl(std::move(mut), cq);
}

future<Status> Table::AsyncApply(SingleRowMutation mut) {
auto cq = background_threads_->cq();
return AsyncApplyImpl(std::move(mut), cq);
Expand Down Expand Up @@ -194,11 +190,6 @@ future<std::vector<FailedMutation>> Table::AsyncBulkApplyImpl(
app_profile_id_, table_name(), std::move(mut));
}

future<std::vector<FailedMutation>> Table::AsyncBulkApply(BulkMutation mut,
CompletionQueue& cq) {
return AsyncBulkApplyImpl(std::move(mut), cq);
}

future<std::vector<FailedMutation>> Table::AsyncBulkApply(BulkMutation mut) {
auto cq = background_threads_->cq();
return AsyncBulkApplyImpl(std::move(mut), cq);
Expand Down Expand Up @@ -316,14 +307,6 @@ future<StatusOr<MutationBranch>> Table::AsyncCheckAndMutateRowImpl(
});
}

future<StatusOr<MutationBranch>> Table::AsyncCheckAndMutateRow(
std::string row_key, Filter filter, std::vector<Mutation> true_mutations,
std::vector<Mutation> false_mutations, CompletionQueue& cq) {
return AsyncCheckAndMutateRowImpl(std::move(row_key), std::move(filter),
std::move(true_mutations),
std::move(false_mutations), cq);
}

future<StatusOr<MutationBranch>> Table::AsyncCheckAndMutateRow(
std::string row_key, Filter filter, std::vector<Mutation> true_mutations,
std::vector<Mutation> false_mutations) {
Expand Down Expand Up @@ -490,12 +473,6 @@ future<StatusOr<std::pair<bool, Row>>> Table::AsyncReadRowImpl(
return handler->GetFuture();
}

future<StatusOr<std::pair<bool, Row>>> Table::AsyncReadRow(CompletionQueue& cq,
std::string row_key,
Filter filter) {
return AsyncReadRowImpl(cq, std::move(row_key), std::move(filter));
}

future<StatusOr<std::pair<bool, Row>>> Table::AsyncReadRow(std::string row_key,
Filter filter) {
auto cq = background_threads_->cq();
Expand Down
258 changes: 0 additions & 258 deletions google/cloud/bigtable/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Status> AsyncApply(SingleRowMutation mut, CompletionQueue& cq);

/**
* Makes asynchronous attempts to apply the mutation to a row.
*
Expand Down Expand Up @@ -453,39 +427,6 @@ class Table {
*/
std::vector<FailedMutation> 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<std::vector<FailedMutation>> AsyncBulkApply(BulkMutation mut,
CompletionQueue& cq);

/**
* Makes asynchronous attempts to apply mutations to multiple rows.
*
Expand Down Expand Up @@ -615,41 +556,6 @@ class Table {
std::string row_key, Filter filter, std::vector<Mutation> true_mutations,
std::vector<Mutation> 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<StatusOr<MutationBranch>> AsyncCheckAndMutateRow(
std::string row_key, Filter filter, std::vector<Mutation> true_mutations,
std::vector<Mutation> false_mutations, CompletionQueue& cq);

/**
* Make an asynchronous request to conditionally mutate a row.
*
Expand Down Expand Up @@ -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 <typename... Args>
GOOGLE_CLOUD_CPP_BIGTABLE_ASYNC_CQ_PARAM_DEPRECATED future<StatusOr<Row>>
AsyncReadModifyWriteRow(std::string row_key, CompletionQueue& cq,
bigtable::ReadModifyWriteRule rule, Args&&... rules) {
return AsyncReadModifyWriteRowImpl(std::move(row_key), cq, std::move(rule),
std::forward<Args>(rules)...);
}

/**
* Make an asynchronous request to atomically read and modify a row.
*
Expand Down Expand Up @@ -851,47 +717,6 @@ class Table {
std::forward<Args>(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<bool>; the returned
* `future<bool>` 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 <typename RowFunctor, typename FinishFunctor>
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.
*
Expand Down Expand Up @@ -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<bool>; the returned
* `future<bool>` 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 <typename RowFunctor, typename FinishFunctor>
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.
*
Expand Down Expand Up @@ -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<StatusOr<std::pair<bool, Row>>> AsyncReadRow(CompletionQueue& cq,
std::string row_key,
Filter filter);

/**
* Asynchronously read and return a single row from the table.
*
Expand Down
6 changes: 0 additions & 6 deletions google/cloud/bigtable/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6b2d219

Please sign in to comment.