@@ -64,13 +64,14 @@ class AsyncRowReader : public std::enable_shared_from_this<AsyncRowReader> {
6464 bigtable::Filter filter, bool reverse,
6565 std::unique_ptr<bigtable::DataRetryPolicy> retry_policy,
6666 std::unique_ptr<BackoffPolicy> backoff_policy,
67- bool enable_server_retries) {
67+ bool enable_server_retries,
68+ std::shared_ptr<OperationContext> operation_context) {
6869 auto reader = std::shared_ptr<AsyncRowReader>(new AsyncRowReader (
6970 std::move (cq), std::move (stub), std::move (app_profile_id),
7071 std::move (table_name), std::move (on_row), std::move (on_finish),
7172 std::move (row_set), rows_limit, std::move (filter), reverse,
7273 std::move (retry_policy), std::move (backoff_policy),
73- enable_server_retries));
74+ enable_server_retries, std::move (operation_context) ));
7475 reader->MakeRequest ();
7576 }
7677
@@ -82,7 +83,8 @@ class AsyncRowReader : public std::enable_shared_from_this<AsyncRowReader> {
8283 bigtable::Filter filter, bool reverse,
8384 std::unique_ptr<bigtable::DataRetryPolicy> retry_policy,
8485 std::unique_ptr<BackoffPolicy> backoff_policy,
85- bool enable_server_retries)
86+ bool enable_server_retries,
87+ std::shared_ptr<OperationContext> operation_context)
8688 : cq_(std::move(cq)),
8789 stub_ (std::move(stub)),
8890 app_profile_id_(std::move(app_profile_id)),
@@ -97,15 +99,16 @@ class AsyncRowReader : public std::enable_shared_from_this<AsyncRowReader> {
9799 backoff_policy_(std::move(backoff_policy)),
98100 enable_server_retries_(enable_server_retries),
99101 options_(internal::SaveCurrentOptions()),
100- call_context_(options_) {}
102+ call_context_(options_),
103+ operation_context_(std::move(operation_context)) {}
101104
102105 void MakeRequest ();
103106
104107 /* *
105108 * Called when the user asks for more rows via satisfying the future returned
106109 * from the row callback.
107110 */
108- void UserWantsRows () { TryGiveRowToUser (); }
111+ void UserWantsRows ();
109112
110113 /* *
111114 * Attempt to call a user callback.
@@ -175,9 +178,8 @@ class AsyncRowReader : public std::enable_shared_from_this<AsyncRowReader> {
175178 int recursion_level_ = 0 ;
176179 internal::ImmutableOptions options_;
177180 internal::CallContext call_context_;
178- std::shared_ptr<grpc::ClientContext> context_;
179- std::shared_ptr<OperationContext> operation_context_ =
180- std::make_shared<OperationContext>();
181+ std::shared_ptr<grpc::ClientContext> client_context_;
182+ std::shared_ptr<OperationContext> operation_context_;
181183};
182184
183185GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
0 commit comments