GPUdb C++ API  Version 7.0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gpudb::RecordRetriever Class Reference

The multi-head record retriever class. More...

#include <gpudb/RecordRetriever.hpp>

Inherits noncopyable.

Public Member Functions

 RecordRetriever (const gpudb::GPUdb &db, const gpudb::Type &record_type, const std::string &table_name, const WorkerList &worker_list)
 
 RecordRetriever (const gpudb::GPUdb &db, const gpudb::Type &record_type, const std::string &table_name)
 
 RecordRetriever (const gpudb::GPUdb &db, const gpudb::Type &record_type, const std::string &table_name, const WorkerList &worker_list, const std::map< std::string, std::string > &retrieval_options)
 
 RecordRetriever (const gpudb::GPUdb &db, const gpudb::Type &record_type, const std::string &table_name, const std::map< std::string, std::string > &retrieval_options)
 
 ~RecordRetriever ()
 
const std::string & getTableName () const
 Returns the name of the table on which this class operates. More...
 
const gpudb::GPUdbgetGPUdb () const
 Returns the GPUdb client handle that this class uses internally. More...
 
const std::map< std::string,
std::string > & 
getOptions () const
 Gets the options currently used for the retriever methods. More...
 
void setOptions (const std::map< std::string, std::string > &options)
 Returns the options currently used for the retriever methods. More...
 
GetRecordsResponse
< gpudb::GenericRecord
getRecordsByKey (const gpudb::GenericRecord &record, const std::string &expression="")
 Retrieves records for a given shard key, optionally further limited by an additional expression. More...
 

Detailed Description

The multi-head record retriever class.

Using this class is significantly more computation-intensive compared to a regular insertion. So, it is highly recommended to use this ingestor only if multi-head ingestion is actually turned on in the server and there is a large volume of records to be inserted.

Also, for now, only key-lookup is available via this class, meaning, the user has to supply the values for all the shard columns via the get_records_by_key() method; also, this method does not support unsharded tables.

Definition at line 37 of file RecordRetriever.hpp.

Constructor & Destructor Documentation

gpudb::RecordRetriever::RecordRetriever ( const gpudb::GPUdb db,
const gpudb::Type record_type,
const std::string &  table_name,
const WorkerList worker_list 
)
gpudb::RecordRetriever::RecordRetriever ( const gpudb::GPUdb db,
const gpudb::Type record_type,
const std::string &  table_name 
)
gpudb::RecordRetriever::RecordRetriever ( const gpudb::GPUdb db,
const gpudb::Type record_type,
const std::string &  table_name,
const WorkerList worker_list,
const std::map< std::string, std::string > &  retrieval_options 
)
gpudb::RecordRetriever::RecordRetriever ( const gpudb::GPUdb db,
const gpudb::Type record_type,
const std::string &  table_name,
const std::map< std::string, std::string > &  retrieval_options 
)
gpudb::RecordRetriever::~RecordRetriever ( )

Member Function Documentation

const gpudb::GPUdb& gpudb::RecordRetriever::getGPUdb ( ) const
inline

Returns the GPUdb client handle that this class uses internally.

Definition at line 69 of file RecordRetriever.hpp.

const std::map<std::string, std::string>& gpudb::RecordRetriever::getOptions ( ) const
inline

Gets the options currently used for the retriever methods.

Note that any gpudb::get_records_by_column_expression option will get overridden at the next getRecordsByKey call with the appropriate expression.

Definition at line 79 of file RecordRetriever.hpp.

GetRecordsResponse<gpudb::GenericRecord> gpudb::RecordRetriever::getRecordsByKey ( const gpudb::GenericRecord record,
const std::string &  expression = "" 
)

Retrieves records for a given shard key, optionally further limited by an additional expression.

All records matching the key and satisfying the expression will be returned, up to the system-defined limit. For multi-head mode the request will be sent directly to the appropriate worker.

All fields in both the shard key and the expression must have defined attribute indexes, unless the shard key is also a primary key and all referenced fields are in the primary key. The expression must be limited to basic equality and inequality comparisons that can be evaluated using the attribute indexes.

Parameters
[in]key_valuesA vector of shard column values
[in]expressionAn optional expression. Default is an empty string.
Returns
const std::string& gpudb::RecordRetriever::getTableName ( ) const
inline

Returns the name of the table on which this class operates.

Definition at line 64 of file RecordRetriever.hpp.

void gpudb::RecordRetriever::setOptions ( const std::map< std::string, std::string > &  options)

Returns the options currently used for the retriever methods.

Note that any gpudb::get_records_by_column_expression option will be overridden at the next getRecordsByKey call with the appropriate expression.


The documentation for this class was generated from the following file: