Google Cloud Bigtable C++ Client 2.13.0
A C++ Client Library for Google Cloud Bigtable
Loading...
Searching...
No Matches
Public Member Functions | List of all members
google::cloud::bigtable_mocks::MockDataConnection Class Reference

A class to mock google::cloud::bigtable::DataConnection. More...

#include <google/cloud/bigtable/mocks/mock_data_connection.h>

Public Member Functions

 MockDataConnection ()
 
 MOCK_METHOD (Options, options,(),(override))
 
 MOCK_METHOD (Status, Apply,(std::string const &table_name, bigtable::SingleRowMutation mut),(override))
 
 MOCK_METHOD (future< Status >, AsyncApply,(std::string const &table_name, bigtable::SingleRowMutation mut),(override))
 
 MOCK_METHOD (std::vector< bigtable::FailedMutation >, BulkApply,(std::string const &table_name, bigtable::BulkMutation mut),(override))
 
 MOCK_METHOD (future< std::vector< bigtable::FailedMutation > >, AsyncBulkApply,(std::string const &table_name, bigtable::BulkMutation mut),(override))
 
 MOCK_METHOD (bigtable::RowReader, ReadRows,(std::string const &table_name, bigtable::RowSet row_set, std::int64_t rows_limit, bigtable::Filter filter),(override))
 Prefer to use ReadRowsFull(). More...
 
 MOCK_METHOD (bigtable::RowReader, ReadRowsFull,(bigtable::ReadRowsParams),(override))
 
 MOCK_METHOD ((StatusOr< std::pair< bool, bigtable::Row > >), ReadRow,(std::string const &table_name, std::string row_key, bigtable::Filter filter),(override))
 
 MOCK_METHOD (StatusOr< bigtable::MutationBranch >, CheckAndMutateRow,(std::string const &table_name, std::string row_key, bigtable::Filter filter, std::vector< bigtable::Mutation > true_mutations, std::vector< bigtable::Mutation > false_mutations),(override))
 
 MOCK_METHOD (future< StatusOr< bigtable::MutationBranch > >, AsyncCheckAndMutateRow,(std::string const &table_name, std::string row_key, bigtable::Filter filter, std::vector< bigtable::Mutation > true_mutations, std::vector< bigtable::Mutation > false_mutations),(override))
 
 MOCK_METHOD (StatusOr< std::vector< bigtable::RowKeySample > >, SampleRows,(std::string const &table_name),(override))
 
 MOCK_METHOD (future< StatusOr< std::vector< bigtable::RowKeySample > > >, AsyncSampleRows,(std::string const &table_name),(override))
 
 MOCK_METHOD (StatusOr< bigtable::Row >, ReadModifyWriteRow,(google::bigtable::v2::ReadModifyWriteRowRequest request),(override))
 
 MOCK_METHOD (future< StatusOr< bigtable::Row > >, AsyncReadModifyWriteRow,(google::bigtable::v2::ReadModifyWriteRowRequest request),(override))
 
 MOCK_METHOD (void, AsyncReadRows,(std::string const &table_name, std::function< future< bool >(bigtable::Row)> on_row, std::function< void(Status)> on_finish, bigtable::RowSet row_set, std::int64_t rows_limit, bigtable::Filter filter),(override))
 
 MOCK_METHOD ((future< StatusOr< std::pair< bool, bigtable::Row > > >), AsyncReadRow,(std::string const &table_name, std::string row_key, bigtable::Filter filter),(override))
 
virtual Options options ()
 
virtual Status Apply (std::string const &table_name, SingleRowMutation mut)
 
virtual future< StatusAsyncApply (std::string const &table_name, SingleRowMutation mut)
 
virtual std::vector< FailedMutation > BulkApply (std::string const &table_name, BulkMutation mut)
 
virtual future< std::vector< FailedMutation > > AsyncBulkApply (std::string const &table_name, BulkMutation mut)
 
virtual RowReader ReadRows (std::string const &table_name, RowSet row_set, std::int64_t rows_limit, Filter filter)
 Prefer to use ReadRowsFull() in mocks. More...
 
virtual RowReader ReadRowsFull (ReadRowsParams params)
 
virtual StatusOr< std::pair< bool, Row > > ReadRow (std::string const &table_name, std::string row_key, Filter filter)
 
virtual StatusOr< MutationBranch > CheckAndMutateRow (std::string const &table_name, std::string row_key, Filter filter, std::vector< Mutation > true_mutations, std::vector< Mutation > false_mutations)
 
virtual future< StatusOr< MutationBranch > > AsyncCheckAndMutateRow (std::string const &table_name, std::string row_key, Filter filter, std::vector< Mutation > true_mutations, std::vector< Mutation > false_mutations)
 
virtual StatusOr< std::vector< RowKeySample > > SampleRows (std::string const &table_name)
 
virtual future< StatusOr< std::vector< RowKeySample > > > AsyncSampleRows (std::string const &table_name)
 
virtual StatusOr< Row > ReadModifyWriteRow (google::bigtable::v2::ReadModifyWriteRowRequest request)
 
virtual future< StatusOr< Row > > AsyncReadModifyWriteRow (google::bigtable::v2::ReadModifyWriteRowRequest request)
 
virtual void AsyncReadRows (std::string const &table_name, std::function< future< bool >(Row)> on_row, std::function< void(Status)> on_finish, RowSet row_set, std::int64_t rows_limit, Filter filter)
 
virtual future< StatusOr< std::pair< bool, Row > > > AsyncReadRow (std::string const &table_name, std::string row_key, Filter filter)
 

Detailed Description

A class to mock google::cloud::bigtable::DataConnection.

Application developers may want to test their code with simulated responses, including errors from a bigtable::Table. To do so, construct a bigtable::Table with an instance of this class. Then use the Google Test framework functions to program the behavior of this mock.

See Mocking the Cloud Bigtable C++ Client with Google Mock for a complete example that mocks Table calls.

Constructor & Destructor Documentation

◆ MockDataConnection()

google::cloud::bigtable_mocks::MockDataConnection::MockDataConnection ( )
inline

Member Function Documentation

◆ Apply()

virtual Status google::cloud::bigtable::DataConnection::Apply ( std::string const &  table_name,
SingleRowMutation  mut 
)
virtualinherited

◆ AsyncApply()

virtual future< Status > google::cloud::bigtable::DataConnection::AsyncApply ( std::string const &  table_name,
SingleRowMutation  mut 
)
virtualinherited

◆ AsyncBulkApply()

virtual future< std::vector< FailedMutation > > google::cloud::bigtable::DataConnection::AsyncBulkApply ( std::string const &  table_name,
BulkMutation  mut 
)
virtualinherited

◆ AsyncCheckAndMutateRow()

virtual future< StatusOr< MutationBranch > > google::cloud::bigtable::DataConnection::AsyncCheckAndMutateRow ( std::string const &  table_name,
std::string  row_key,
Filter  filter,
std::vector< Mutation true_mutations,
std::vector< Mutation false_mutations 
)
virtualinherited

◆ AsyncReadModifyWriteRow()

virtual future< StatusOr< Row > > google::cloud::bigtable::DataConnection::AsyncReadModifyWriteRow ( google::bigtable::v2::ReadModifyWriteRowRequest  request)
virtualinherited

◆ AsyncReadRow()

virtual future< StatusOr< std::pair< bool, Row > > > google::cloud::bigtable::DataConnection::AsyncReadRow ( std::string const &  table_name,
std::string  row_key,
Filter  filter 
)
virtualinherited

◆ AsyncReadRows()

virtual void google::cloud::bigtable::DataConnection::AsyncReadRows ( std::string const &  table_name,
std::function< future< bool >(Row)>  on_row,
std::function< void(Status)>  on_finish,
RowSet  row_set,
std::int64_t  rows_limit,
Filter  filter 
)
virtualinherited

◆ AsyncSampleRows()

virtual future< StatusOr< std::vector< RowKeySample > > > google::cloud::bigtable::DataConnection::AsyncSampleRows ( std::string const &  table_name)
virtualinherited

◆ BulkApply()

virtual std::vector< FailedMutation > google::cloud::bigtable::DataConnection::BulkApply ( std::string const &  table_name,
BulkMutation  mut 
)
virtualinherited

◆ CheckAndMutateRow()

virtual StatusOr< MutationBranch > google::cloud::bigtable::DataConnection::CheckAndMutateRow ( std::string const &  table_name,
std::string  row_key,
Filter  filter,
std::vector< Mutation true_mutations,
std::vector< Mutation false_mutations 
)
virtualinherited

◆ MOCK_METHOD() [1/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( (future< StatusOr< std::pair< bool, bigtable::Row > > >)  ,
AsyncReadRow  ,
(std::string const &table_name, std::string row_key, bigtable::Filter filter)  ,
(override)   
)

◆ MOCK_METHOD() [2/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( (StatusOr< std::pair< bool, bigtable::Row > >)  ,
ReadRow  ,
(std::string const &table_name, std::string row_key, bigtable::Filter filter)  ,
(override)   
)

◆ MOCK_METHOD() [3/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( bigtable::RowReader  ,
ReadRows  ,
(std::string const &table_name, bigtable::RowSet row_set, std::int64_t rows_limit, bigtable::Filter filter)  ,
(override)   
)

Prefer to use ReadRowsFull().

◆ MOCK_METHOD() [4/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( bigtable::RowReader  ,
ReadRowsFull  ,
(bigtable::ReadRowsParams ,
(override)   
)

◆ MOCK_METHOD() [5/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( future< Status ,
AsyncApply  ,
(std::string const &table_name, bigtable::SingleRowMutation mut)  ,
(override)   
)

◆ MOCK_METHOD() [6/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( future< StatusOr< bigtable::MutationBranch > >  ,
AsyncCheckAndMutateRow  ,
(std::string const &table_name, std::string row_key, bigtable::Filter filter, std::vector< bigtable::Mutation > true_mutations, std::vector< bigtable::Mutation > false_mutations)  ,
(override)   
)

◆ MOCK_METHOD() [7/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( future< StatusOr< bigtable::Row > >  ,
AsyncReadModifyWriteRow  ,
(google::bigtable::v2::ReadModifyWriteRowRequest request)  ,
(override)   
)

◆ MOCK_METHOD() [8/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( future< StatusOr< std::vector< bigtable::RowKeySample > > >  ,
AsyncSampleRows  ,
(std::string const &table_name)  ,
(override)   
)

◆ MOCK_METHOD() [9/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( future< std::vector< bigtable::FailedMutation > >  ,
AsyncBulkApply  ,
(std::string const &table_name, bigtable::BulkMutation mut)  ,
(override)   
)

◆ MOCK_METHOD() [10/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( Options  ,
options  ,
()  ,
(override)   
)

◆ MOCK_METHOD() [11/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( Status  ,
Apply  ,
(std::string const &table_name, bigtable::SingleRowMutation mut)  ,
(override)   
)

◆ MOCK_METHOD() [12/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( StatusOr< bigtable::MutationBranch ,
CheckAndMutateRow  ,
(std::string const &table_name, std::string row_key, bigtable::Filter filter, std::vector< bigtable::Mutation > true_mutations, std::vector< bigtable::Mutation > false_mutations)  ,
(override)   
)

◆ MOCK_METHOD() [13/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( StatusOr< bigtable::Row ,
ReadModifyWriteRow  ,
(google::bigtable::v2::ReadModifyWriteRowRequest request)  ,
(override)   
)

◆ MOCK_METHOD() [14/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( StatusOr< std::vector< bigtable::RowKeySample > >  ,
SampleRows  ,
(std::string const &table_name)  ,
(override)   
)

◆ MOCK_METHOD() [15/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( std::vector< bigtable::FailedMutation ,
BulkApply  ,
(std::string const &table_name, bigtable::BulkMutation mut)  ,
(override)   
)

◆ MOCK_METHOD() [16/16]

google::cloud::bigtable_mocks::MockDataConnection::MOCK_METHOD ( void  ,
AsyncReadRows  ,
(std::string const &table_name, std::function< future< bool >(bigtable::Row)> on_row, std::function< void(Status)> on_finish, bigtable::RowSet row_set, std::int64_t rows_limit, bigtable::Filter filter)  ,
(override)   
)

◆ options()

virtual Options google::cloud::bigtable::DataConnection::options ( )
inlinevirtualinherited

◆ ReadModifyWriteRow()

virtual StatusOr< Row > google::cloud::bigtable::DataConnection::ReadModifyWriteRow ( google::bigtable::v2::ReadModifyWriteRowRequest  request)
virtualinherited

◆ ReadRow()

virtual StatusOr< std::pair< bool, Row > > google::cloud::bigtable::DataConnection::ReadRow ( std::string const &  table_name,
std::string  row_key,
Filter  filter 
)
virtualinherited

◆ ReadRows()

virtual RowReader google::cloud::bigtable::DataConnection::ReadRows ( std::string const &  table_name,
RowSet  row_set,
std::int64_t  rows_limit,
Filter  filter 
)
virtualinherited

Prefer to use ReadRowsFull() in mocks.

◆ ReadRowsFull()

virtual RowReader google::cloud::bigtable::DataConnection::ReadRowsFull ( ReadRowsParams  params)
virtualinherited

◆ SampleRows()

virtual StatusOr< std::vector< RowKeySample > > google::cloud::bigtable::DataConnection::SampleRows ( std::string const &  table_name)
virtualinherited