The ReadPartition
class is a regular type that represents a single slice of a parallel Read operation.
More...
#include <google/cloud/spanner/read_partition.h>
The ReadPartition
class is a regular type that represents a single slice of a parallel Read operation.
Instances of ReadPartition
are created by Client::PartitionRead
. Once created, ReadPartition
objects can be serialized, transmitted to separate process, and used to read data in parallel using Client::Read
.
Definition at line 94 of file read_partition.h.
◆ ReadPartition() [1/3]
google::cloud::spanner::v1::ReadPartition::ReadPartition |
( |
| ) |
|
|
default |
Constructs an instance of ReadPartition
that does not specify any table or columns to be read.
◆ ReadPartition() [2/3]
google::cloud::spanner::v1::ReadPartition::ReadPartition |
( |
ReadPartition const & |
| ) |
|
|
default |
◆ ReadPartition() [3/3]
google::cloud::spanner::v1::ReadPartition::ReadPartition |
( |
ReadPartition && |
| ) |
|
|
default |
◆ ColumnNames()
std::vector<std::string> google::cloud::spanner::v1::ReadPartition::ColumnNames |
( |
| ) |
const |
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ ReadOptions()
google::cloud::spanner::ReadOptions google::cloud::spanner::v1::ReadPartition::ReadOptions |
( |
| ) |
const |
|
inline |
◆ TableName()
std::string google::cloud::spanner::v1::ReadPartition::TableName |
( |
| ) |
const |
|
inline |
◆ DeserializeReadPartition
StatusOr<ReadPartition> DeserializeReadPartition |
( |
std::string const & |
serialized_read_partition | ) |
|
|
friend |
Deserializes the provided string into a ReadPartition
.
The serialized_read_partition
argument must be a string that was previously returned by a call to SerializeReadPartition()
.
- Note
- The serialized string may contain NUL and other non-printable characters. Therefore, callers should avoid formatted IO functions that may incorrectly reformat the string data.
- Parameters
-
serialized_read_partition | - string representation to be deserialized. |
- Example
google::cloud::StatusOr<google::cloud::spanner::ReadPartition>
ReceiveReadPartitionFromRemoteMachine() {
std::string serialized_partition = Receive();
serialized_partition);
}
Definition at line 60 of file read_partition.cc.
◆ operator!=
◆ operator==
◆ ReadPartitionTester
friend class ReadPartitionTester |
|
friend |
◆ SerializeReadPartition
StatusOr<std::string> SerializeReadPartition |
( |
ReadPartition const & |
read_partition | ) |
|
|
friend |
Serializes an instance of ReadPartition
to a string of bytes.
The serialized string of bytes is suitable for writing to disk or transmission to another process.
- Note
- The serialized string may contain NUL and other non-printable characters. Therefore, callers should avoid formatted IO functions that may incorrectly reformat the string data.
- Parameters
-
read_partition | - instance to be serialized. |
- Example
namespace spanner = ::google::cloud::spanner;
google::cloud::StatusOr<std::string> serialized_partition =
if (!serialized_partition) {
throw std::runtime_error(serialized_partition.status().message());
}
std::string const& bytes = *serialized_partition;
SendBinaryStringData(bytes);
Definition at line 50 of file read_partition.cc.