@@ -54,11 +54,13 @@ RowStream Client::Read(std::string table, KeySet keys,
5454 opts = internal::MergeOptions (std::move (opts), opts_);
5555 auto directed_read_option = ExtractOpt<DirectedReadOption>(opts);
5656 internal::OptionsSpan span (std::move (opts));
57+ auto lock_hint = ExtractOpt<LockHintOption>(opts);
5758 return conn_->Read ({spanner_internal::MakeSingleUseTransaction (
5859 Transaction::ReadOnlyOptions ()),
5960 std::move (table), std::move (keys), std::move (columns),
6061 ToReadOptions (internal::CurrentOptions ()), absl::nullopt ,
61- false , std::move (directed_read_option)});
62+ false , std::move (directed_read_option),
63+ std::move (lock_hint)});
6264}
6365
6466RowStream Client::Read (Transaction::SingleUseOptions transaction_options,
@@ -67,30 +69,35 @@ RowStream Client::Read(Transaction::SingleUseOptions transaction_options,
6769 opts = internal::MergeOptions (std::move (opts), opts_);
6870 auto directed_read_option = ExtractOpt<DirectedReadOption>(opts);
6971 internal::OptionsSpan span (std::move (opts));
72+ auto lock_hint = ExtractOpt<LockHintOption>(opts);
7073 return conn_->Read ({spanner_internal::MakeSingleUseTransaction (
7174 std::move (transaction_options)),
7275 std::move (table), std::move (keys), std::move (columns),
7376 ToReadOptions (internal::CurrentOptions ()), absl::nullopt ,
74- false , std::move (directed_read_option)});
77+ false , std::move (directed_read_option),
78+ std::move (lock_hint)});
7579}
7680
7781RowStream Client::Read (Transaction transaction, std::string table, KeySet keys,
7882 std::vector<std::string> columns, Options opts) {
7983 opts = internal::MergeOptions (std::move (opts), opts_);
8084 auto directed_read_option = ExtractOpt<DirectedReadOption>(opts);
85+ auto lock_hint = ExtractOpt<LockHintOption>(opts);
8186 internal::OptionsSpan span (std::move (opts));
8287 return conn_->Read ({std::move (transaction), std::move (table), std::move (keys),
8388 std::move (columns),
8489 ToReadOptions (internal::CurrentOptions ()), absl::nullopt ,
85- false , std::move (directed_read_option)});
90+ false , std::move (directed_read_option),
91+ std::move (lock_hint)});
8692}
8793
8894RowStream Client::Read (ReadPartition const & read_partition, Options opts) {
8995 opts = internal::MergeOptions (std::move (opts), opts_);
9096 auto directed_read_option = ExtractOpt<DirectedReadOption>(opts);
97+ auto lock_hint = ExtractOpt<LockHintOption>(opts);
9198 internal::OptionsSpan span (std::move (opts));
9299 return conn_->Read (spanner_internal::MakeReadParams (
93- read_partition, std::move (directed_read_option)));
100+ read_partition, std::move (directed_read_option), std::move (lock_hint) ));
94101}
95102
96103StatusOr<std::vector<ReadPartition>> Client::PartitionRead (
@@ -100,7 +107,8 @@ StatusOr<std::vector<ReadPartition>> Client::PartitionRead(
100107 return conn_->PartitionRead (
101108 {{std::move (transaction), std::move (table), std::move (keys),
102109 std::move (columns), ToReadOptions (internal::CurrentOptions ()),
103- absl::nullopt , false , DirectedReadOption::Type{}},
110+ absl::nullopt , false , DirectedReadOption::Type{},
111+ LockHint::kLockHintUnspecified },
104112 ToPartitionOptions (internal::CurrentOptions ())});
105113}
106114
0 commit comments