GPUdb C++ API  Version 6.2.0.3
RecordRetriever.hpp
Go to the documentation of this file.
1 #ifndef __RECORD_RETRIEVER_HPP__
2 #define __RECORD_RETRIEVER_HPP__
3 
4 #include "gpudb/GPUdb.hpp"
5 #include "gpudb/Http.hpp"
6 #include "gpudb/Type.hpp"
8 
9 
10 #include <atomic>
11 #include <map>
12 #include <string>
13 #include <vector>
14 
15 #include <boost/noncopyable.hpp>
16 #include <boost/shared_ptr.hpp>
17 
18 
19 namespace gpudb
20 {
21 
22 // Forward declaration
23 class GPUdb;
24 
25 
37 class RecordRetriever : private boost::noncopyable
38 {
39 
40 public:
41 
42  RecordRetriever( const gpudb::GPUdb& db, const gpudb::Type& record_type,
43  const std::string& table_name,
44  const WorkerList& worker_list );
45 
46  RecordRetriever( const gpudb::GPUdb& db, const gpudb::Type& record_type,
47  const std::string& table_name );
48 
49 
51 
55  const std::string& getTableName() const { return m_table_name; }
56 
60  const gpudb::GPUdb& getGPUdb() const { return m_db; }
61 
62 
82  const std::string& expression = "" );
83 
84 
85 private:
86 
87  typedef std::map<std::string, std::string> str_to_str_map_t;
88  typedef boost::shared_ptr<gpudb::WorkerQueue> worker_queue_ptr_t;
89 
90 
92 
93  void construct( const gpudb::GPUdb& db,
94  const gpudb::Type& record_type,
95  const std::string& table_name,
96  const WorkerList& worker_list );
97 
98  const gpudb::GPUdb& m_db;
99  std::string m_table_name;
100  gpudb::Type m_record_type;
101  gpudb::RecordKeyBuilder* m_shard_key_builder_ptr;
102  std::vector<int32_t> m_routing_table;
103  std::vector<worker_queue_ptr_t> m_worker_queues;
104 
105 }; // end class RecordRetriever
106 
107 
108 
109 } // namespace gpudb
110 
111 
112 
113 #endif // __RECORD_RETRIEVER_HPP__
114 
115 
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...
const std::string & getTableName() const
Returns the name of the table on which this class operates.
The multi-head record retriever class.
A set of output parameters for getRecords(const GetRecordsRequest&) const.
Definition: get_records.h:382
const gpudb::GPUdb & getGPUdb() const
Returns the GPUdb client handle that this class uses internally.