Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
google::cloud::spanner::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

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 processes, and used to read data in parallel using Client::Read. If data_boost is set, those requests will be executed using the independent compute resources of Cloud Spanner Data Boost.

Constructor & Destructor Documentation

◆ ReadPartition() [1/3]

google::cloud::spanner::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::ReadPartition::ReadPartition ( ReadPartition const &  )
default

◆ ReadPartition() [3/3]

google::cloud::spanner::ReadPartition::ReadPartition ( ReadPartition &&  )
default

Member Function Documentation

◆ ColumnNames()

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ ReadOptions()

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

◆ TableName()

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

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

◆ operator!=

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

◆ operator==

bool operator== ( ReadPartition const &  lhs,
ReadPartition const &  rhs 
)
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::move(serialized_partition).status();
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.