1 #ifndef __GPUDB_INGESTOR_HPP__     2 #define __GPUDB_INGESTOR_HPP__    16 #include <boost/noncopyable.hpp>    17 #include <boost/shared_ptr.hpp>    39                    const std::string& table_name,
    41                    const std::map<std::string, std::string>& insert_options,
    45                    const std::string& table_name,
    51                    const std::string& table_name,
    52                    const std::map<std::string, std::string>& insert_options,
    56                    const std::string& table_name, 
size_t batch_size );
    73     const std::map<std::string, std::string>& 
getOptions()
 const { 
return m_insert_options; }
    91     std::vector<GPUdbInsertionException> 
getErrors();
   133     void insert( std::vector<gpudb::GenericRecord> records );
   138     typedef std::map<std::string, std::string>          str_to_str_map_t;
   139     typedef boost::shared_ptr<gpudb::WorkerQueue>       worker_queue_ptr_t;
   146                     const std::string& table_name,
   154     void flush( 
const std::vector<gpudb::GenericRecord>& queue,
   158     std::string                      m_table_name;
   160     bool                             m_return_individual_errors;
   161     bool                             m_simulate_error_mode; 
   162     std::atomic<size_t>              m_count_inserted;
   163     std::atomic<size_t>              m_count_updated;
   164     str_to_str_map_t                 m_insert_options;
   170     std::vector<int32_t>             m_routing_table;
   171     std::vector<worker_queue_ptr_t>  m_worker_queues;
   172     std::vector<GPUdbInsertionException> m_error_list;
   173     std::vector<GPUdbInsertionException> m_warning_list;
   174     std::mutex                       m_error_list_lock;
   184 #endif // __GPUDB_INGESTOR_HPP__ 
void insert(gpudb::GenericRecord record)
Queues a record for insertion into GPUdb.
std::vector< GPUdbInsertionException > getWarnings()
Returns the list of warnings received since the last call to getWarnings(), and clears the list.
const std::string & getTableName() const
Returns the name of the table on which this class operates.
const gpudb::GPUdb & getGPUdb() const
Returns the GPUdb client handle that this class uses internally.
size_t getCountUpdated() const
Returns the count of records updated so far through this ingestor instance; An atomic operation.
const std::map< std::string, std::string > & getOptions() const
Returns the insertion options the ingestor uses.
size_t getCountInserted() const
Returns the count of records inserted so far through this ingestor instance; An atomic operation.
void flush()
Ensures that all queued records are inserted into the database.
std::vector< GPUdbInsertionException > getErrors()
Returns the list of errors received since the last call to getErrors(), and clears the list.