15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_READ_PARTITION_H 16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_READ_PARTITION_H 22 #include <google/spanner/v1/spanner.pb.h> 52 ReadPartition
const& read_partition);
73 std::string
const& serialized_read_partition);
77 ReadPartition MakeReadPartition(std::string transaction_id,
78 std::string session_id,
79 std::string partition_token,
80 std::string table_name, KeySet key_set,
81 std::vector<std::string> column_names,
82 ReadOptions read_options = {});
83 Connection::ReadParams MakeReadParams(ReadPartition
const& read_partition);
110 std::string
TableName()
const {
return proto_.table(); }
112 auto const& columns = proto_.columns();
113 return std::vector<std::string>(columns.begin(), columns.end());
116 google::cloud::spanner::ReadOptions options;
117 options.index_name = proto_.index();
118 options.limit = proto_.limit();
129 friend class ReadPartitionTester;
131 std::string transaction_id, std::string session_id,
132 std::string partition_token, std::string table_name,
KeySet key_set,
133 std::vector<std::string> column_names,
134 google::cloud::spanner::ReadOptions read_options);
140 std::string
const& serialized_read_partition);
142 explicit ReadPartition(google::spanner::v1::ReadRequest proto)
143 : proto_(std::move(proto)) {}
144 ReadPartition(std::string transaction_id, std::string session_id,
145 std::string partition_token, std::string table_name,
146 google::cloud::spanner::KeySet key_set,
147 std::vector<std::string> column_names,
148 google::cloud::spanner::ReadOptions read_options = {});
151 std::string PartitionToken()
const {
return proto_.partition_token(); }
152 std::string SessionId()
const {
return proto_.session(); }
153 std::string TransactionId()
const {
return proto_.transaction().id(); }
154 google::spanner::v1::KeySet KeySet()
const {
return proto_.key_set(); }
156 google::spanner::v1::ReadRequest proto_;
164 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_READ_PARTITION_H StatusOr< std::string > SerializeReadPartition(ReadPartition const &read_partition)
Serializes an instance of ReadPartition to a string of bytes.
bool operator!=(Backup const &a, Backup const &b)
StatusOr< ReadPartition > DeserializeReadPartition(std::string const &serialized_read_partition)
Deserializes the provided string into a ReadPartition.
std::string TableName() const
bool operator==(Backup const &a, Backup const &b)
Wrap the arguments to Read().
The KeySet class is a regular type that represents a collection of Keys.
Contains all the Cloud Spanner C++ client types and functions.
google::cloud::spanner::ReadOptions ReadOptions() const
The ReadPartition class is a regular type that represents a single slice of a parallel Read operation...
std::vector< std::string > ColumnNames() const
#define SPANNER_CLIENT_NS