15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_QUERY_PARTITION_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_QUERY_PARTITION_H
18 #include "google/cloud/spanner/connection.h"
19 #include "google/cloud/spanner/sql_statement.h"
20 #include "google/cloud/spanner/version.h"
21 #include "google/cloud/status_or.h"
27 namespace spanner_internal {
29 struct QueryPartitionInternals;
76 std::string
const& serialized_query_partition);
116 friend class QueryPartitionTester;
121 std::string
const& serialized_query_partition);
123 QueryPartition(std::string transaction_id, std::string transaction_tag,
124 std::string session_id, std::string partition_token,
128 std::string
const& partition_token()
const {
return partition_token_; }
129 std::string
const& session_id()
const {
return session_id_; }
130 std::string
const& transaction_tag()
const {
return transaction_tag_; }
131 std::string
const& transaction_id()
const {
return transaction_id_; }
133 std::string transaction_id_;
134 std::string transaction_tag_;
135 std::string session_id_;
136 std::string partition_token_;
144 namespace spanner_internal {
147 struct QueryPartitionInternals {
149 std::string
const& transaction_id, std::string
const& transaction_tag,
150 std::string
const& session_id, std::string
const& partition_token,
153 partition_token, sql_statement);
159 return {MakeTransactionFromIds(query_partition.session_id(),
160 query_partition.transaction_id(),
161 query_partition.transaction_tag()),
163 query_partition.partition_token()};
168 std::string
const& transaction_id, std::string
const& transaction_tag,
169 std::string
const& session_id, std::string
const& partition_token,
171 return QueryPartitionInternals::MakeQueryPartition(
172 transaction_id, transaction_tag, session_id, partition_token,
178 return QueryPartitionInternals::MakeSqlParams(query_partition);