Google Cloud Spanner C++ Client  1.32.1
A C++ Client Library for Google Cloud Spanner
Public Member Functions | Friends | List of all members
google::cloud::spanner::v1::ReadPartition Class Reference

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>

Public Member Functions

 ReadPartition ()=default
 Constructs an instance of ReadPartition that does not specify any table or columns to be read. More...
 
std::string TableName () const
 
std::vector< std::string > ColumnNames () const
 
google::cloud::spanner::ReadOptions ReadOptions () const
 
Copy and move.
 ReadPartition (ReadPartition const &)=default
 
 ReadPartition (ReadPartition &&)=default
 
ReadPartitionoperator= (ReadPartition const &)=default
 
ReadPartitionoperator= (ReadPartition &&)=default
 

Friends

class ReadPartitionTester
 
StatusOr< std::string > SerializeReadPartition (ReadPartition const &read_partition)
 Serializes an instance of ReadPartition to a string of bytes. More...
 
StatusOr< ReadPartitionDeserializeReadPartition (std::string const &serialized_read_partition)
 Deserializes the provided string into a ReadPartition. More...
 
Equality
bool operator== (ReadPartition const &lhs, ReadPartition const &rhs)
 
bool operator!= (ReadPartition const &lhs, ReadPartition const &rhs)
 

Detailed Description

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 87 of file read_partition.h.

Constructor & Destructor Documentation

◆ 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

Member Function Documentation

◆ ColumnNames()

std::vector<std::string> google::cloud::spanner::v1::ReadPartition::ColumnNames ( ) const
inline

Definition at line 105 of file read_partition.h.

◆ operator=() [1/2]

ReadPartition& google::cloud::spanner::v1::ReadPartition::operator= ( ReadPartition &&  )
default

◆ operator=() [2/2]

ReadPartition& google::cloud::spanner::v1::ReadPartition::operator= ( ReadPartition const &  )
default

◆ ReadOptions()

google::cloud::spanner::ReadOptions google::cloud::spanner::v1::ReadPartition::ReadOptions ( ) const

Definition at line 66 of file read_partition.cc.

◆ TableName()

std::string google::cloud::spanner::v1::ReadPartition::TableName ( ) const
inline

Definition at line 103 of file read_partition.h.

Friends And Related Function Documentation

◆ 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);
}
StatusOr< ReadPartition > DeserializeReadPartition(std::string const &serialized_read_partition)
Deserializes the provided string into a ReadPartition.

Definition at line 110 of file read_partition.cc.

◆ operator!=

bool operator!= ( ReadPartition const &  lhs,
ReadPartition const &  rhs 
)
friend

Definition at line 96 of file read_partition.cc.

◆ operator==

bool operator== ( ReadPartition const &  lhs,
ReadPartition const &  rhs 
)
friend

Definition at line 91 of file read_partition.cc.

◆ ReadPartitionTester

friend class ReadPartitionTester
friend

Definition at line 119 of file read_partition.h.

◆ 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;
// `bytes` contains the serialized data, which may contain NULs and other
// non-printable characters.
SendBinaryStringData(bytes);
StatusOr< std::string > SerializeReadPartition(ReadPartition const &read_partition)
Serializes an instance of ReadPartition to a string of bytes.
Contains all the Cloud Spanner C++ client types and functions.
Definition: backup.cc:21

Definition at line 100 of file read_partition.cc.