File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
google/cloud/bigtable/internal Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1717#include " google/cloud/internal/absl_str_cat_quiet.h"
1818#include " google/cloud/internal/make_status.h"
1919#include " google/cloud/log.h"
20+ #include " absl/strings/cord.h"
2021#include " absl/types/optional.h"
2122
2223namespace google {
2324namespace cloud {
2425namespace bigtable_internal {
2526
2627GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
28+ namespace {
29+ // Some Bigtable proto fields use Cord internally and string externally.
30+ template <typename T, typename std::enable_if<
31+ std::is_same<T, std::string>::value>::type* = nullptr >
32+ std::string AsString (T const & s) {
33+ return s;
34+ }
35+
36+ template <typename T, typename std::enable_if<
37+ std::is_same<T, absl::Cord>::value>::type* = nullptr >
38+ std::string AsString (T const & s) {
39+ return std::string (s);
40+ }
41+ } // namespace
2742
2843StatusOr<std::unique_ptr<bigtable::ResultSourceInterface>>
2944PartialResultSetSource::Create (
@@ -163,7 +178,7 @@ Status PartialResultSetSource::ProcessDataFromStream(
163178 rows_.insert (rows_.end (), buffered_rows_.begin (), buffered_rows_.end ());
164179 buffered_rows_.clear ();
165180 read_buffer_.clear ();
166- resume_token_ = result.resume_token ();
181+ resume_token_ = AsString ( result.resume_token () );
167182 }
168183 return {}; // OK
169184}
You can’t perform that action at this time.
0 commit comments