OmniSciDB
a5dc49c757
|
#include <Importer.h>
Public Member Functions | |
Loader (Catalog_Namespace::Catalog &c, const TableDescriptor *t, LoadCallbackType load_callback=nullptr) | |
virtual | ~Loader () |
Catalog_Namespace::Catalog & | getCatalog () const |
const TableDescriptor * | getTableDesc () const |
const std::list< const ColumnDescriptor * > & | get_column_descs () const |
StringDictionary * | getStringDict (const ColumnDescriptor *cd) const |
virtual bool | load (const std::vector< std::unique_ptr< TypedImportBuffer >> &import_buffers, const size_t row_count, const Catalog_Namespace::SessionInfo *session_info) |
virtual bool | loadNoCheckpoint (const std::vector< std::unique_ptr< TypedImportBuffer >> &import_buffers, const size_t row_count, const Catalog_Namespace::SessionInfo *session_info) |
virtual void | checkpoint () |
virtual std::vector < Catalog_Namespace::TableEpochInfo > | getTableEpochs () const |
virtual void | setTableEpochs (const std::vector< Catalog_Namespace::TableEpochInfo > &table_epochs) |
void | setAddingColumns (const bool adding_columns) |
bool | isAddingColumns () const |
void | dropColumns (const std::vector< int > &columns) |
std::string | getErrorMessage () |
Protected Types | |
using | OneShardBuffers = std::vector< std::unique_ptr< TypedImportBuffer >> |
Protected Member Functions | |
void | init () |
virtual bool | loadImpl (const std::vector< std::unique_ptr< TypedImportBuffer >> &import_buffers, size_t row_count, bool checkpoint, const Catalog_Namespace::SessionInfo *session_info) |
void | distributeToShards (std::vector< OneShardBuffers > &all_shard_import_buffers, std::vector< size_t > &all_shard_row_counts, const OneShardBuffers &import_buffers, const size_t row_count, const size_t shard_count, const Catalog_Namespace::SessionInfo *session_info) |
Protected Attributes | |
Catalog_Namespace::Catalog & | catalog_ |
const TableDescriptor * | table_desc_ |
std::list< const ColumnDescriptor * > | column_descs_ |
LoadCallbackType | load_callback_ |
Fragmenter_Namespace::InsertData | insert_data_ |
std::map< int, StringDictionary * > | dict_map_ |
Private Types | |
using | LoadCallbackType = std::function< bool(const std::vector< std::unique_ptr< TypedImportBuffer >> &, std::vector< DataBlockPtr > &, size_t)> |
Private Member Functions | |
bool | loadToShard (const std::vector< std::unique_ptr< TypedImportBuffer >> &import_buffers, size_t row_count, const TableDescriptor *shard_table, bool checkpoint, const Catalog_Namespace::SessionInfo *session_info) |
void | distributeToShardsNewColumns (std::vector< OneShardBuffers > &all_shard_import_buffers, std::vector< size_t > &all_shard_row_counts, const OneShardBuffers &import_buffers, const size_t row_count, const size_t shard_count, const Catalog_Namespace::SessionInfo *session_info) |
void | distributeToShardsExistingColumns (std::vector< OneShardBuffers > &all_shard_import_buffers, std::vector< size_t > &all_shard_row_counts, const OneShardBuffers &import_buffers, const size_t row_count, const size_t shard_count, const Catalog_Namespace::SessionInfo *session_info) |
void | fillShardRow (const size_t row_index, OneShardBuffers &shard_output_buffers, const OneShardBuffers &import_buffers) |
Private Attributes | |
bool | adding_columns_ = false |
std::mutex | loader_mutex_ |
std::string | error_msg_ |
Definition at line 557 of file Importer.h.
|
private |
Definition at line 561 of file Importer.h.
|
protected |
Definition at line 619 of file Importer.h.
|
inline |
Definition at line 565 of file Importer.h.
References init().
|
inlinevirtual |
Definition at line 575 of file Importer.h.
|
virtual |
Definition at line 4564 of file Importer.cpp.
References Catalog_Namespace::Catalog::checkpointWithAutoRollback(), Data_Namespace::DISK_LEVEL, getCatalog(), and getTableDesc().
|
protected |
Definition at line 2872 of file Importer.cpp.
References CHECK_GT, distributeToShardsExistingColumns(), distributeToShardsNewColumns(), isAddingColumns(), TableDescriptor::shardedColumnId, and table_desc_.
Referenced by loadImpl().
|
private |
Definition at line 2813 of file Importer.cpp.
References CHECK, CHECK_LE, column_descs_, fillShardRow(), import_export::anonymous_namespace{Importer.cpp}::int_value_at(), kENCODING_DICT, SHARD_FOR_KEY, TableDescriptor::shardedColumnId, and table_desc_.
Referenced by distributeToShards().
|
private |
Definition at line 2851 of file Importer.cpp.
References catalog_, CHECK, fillShardRow(), Catalog_Namespace::Catalog::getPhysicalTablesDescriptors(), and table_desc_.
Referenced by distributeToShards().
void import_export::Loader::dropColumns | ( | const std::vector< int > & | columns | ) |
Definition at line 3055 of file Importer.cpp.
References catalog_, Catalog_Namespace::Catalog::getPhysicalTablesDescriptors(), TableDescriptor::nShards, and table_desc_.
|
private |
Definition at line 2739 of file Importer.cpp.
References CHECK, CHECK_LT, decimal_to_int_type(), import_export::anonymous_namespace{Importer.cpp}::double_value_at(), import_export::anonymous_namespace{Importer.cpp}::float_value_at(), import_export::anonymous_namespace{Importer.cpp}::int_value_at(), IS_STRING, kARRAY, kBIGINT, kBOOLEAN, kCHAR, kDATE, kDOUBLE, kFLOAT, kINT, kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kPOINT, kPOLYGON, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, and run_benchmark_import::type.
Referenced by distributeToShardsExistingColumns(), and distributeToShardsNewColumns().
|
inline |
Definition at line 579 of file Importer.h.
References column_descs_.
Referenced by import_export::setup_column_loaders().
|
inline |
Definition at line 577 of file Importer.h.
References catalog_.
Referenced by checkpoint(), getTableEpochs(), and setTableEpochs().
|
inline |
|
inline |
Definition at line 583 of file Importer.h.
References ColumnDescriptor::columnId, ColumnDescriptor::columnType, dict_map_, SQLTypeInfo::get_compression(), SQLTypeInfo::get_subtype(), SQLTypeInfo::get_type(), IS_STRING, SQLTypeInfo::is_string(), kARRAY, and kENCODING_DICT.
Referenced by import_export::setup_column_loaders().
|
inline |
Definition at line 578 of file Importer.h.
References table_desc_.
Referenced by checkpoint(), and getTableEpochs().
|
virtual |
Definition at line 4572 of file Importer.cpp.
References getCatalog(), getTableDesc(), and Catalog_Namespace::Catalog::getTableEpochs().
|
protected |
Definition at line 3065 of file Importer.cpp.
References catalog_, CHECK, column_descs_, Fragmenter_Namespace::InsertData::columnIds, Fragmenter_Namespace::InsertData::databaseId, Catalog_Namespace::DBMetadata::dbId, dict_map_, Catalog_Namespace::Catalog::getCurrentDB(), Catalog_Namespace::Catalog::getMetadataForDict(), insert_data_, kENCODING_DICT, Fragmenter_Namespace::InsertData::numRows, table_desc_, TableDescriptor::tableId, and Fragmenter_Namespace::InsertData::tableId.
Referenced by Loader().
|
inline |
Definition at line 606 of file Importer.h.
References adding_columns_.
Referenced by distributeToShards(), and loadToShard().
|
virtual |
Reimplemented in DistributedLoader.
Definition at line 2684 of file Importer.cpp.
References loadImpl().
|
protectedvirtual |
Definition at line 2905 of file Importer.cpp.
References catalog_, distributeToShards(), import_export::TypedImportBuffer::get_data_block_pointers(), Catalog_Namespace::Catalog::getPhysicalTablesDescriptors(), load_callback_, loadToShard(), TableDescriptor::nShards, and table_desc_.
Referenced by load(), and loadNoCheckpoint().
|
virtual |
Definition at line 2677 of file Importer.cpp.
References loadImpl().
|
private |
Definition at line 2998 of file Importer.cpp.
References Fragmenter_Namespace::InsertData::columnIds, Fragmenter_Namespace::InsertData::data, logger::ERROR, error_msg_, TableDescriptor::fragmenter, import_export::TypedImportBuffer::get_data_block_pointers(), insert_data_, Fragmenter_Namespace::InsertData::is_default, isAddingColumns(), loader_mutex_, LOG, Fragmenter_Namespace::InsertData::numRows, and TableDescriptor::tableName.
Referenced by loadImpl().
|
inline |
|
virtual |
Definition at line 4577 of file Importer.cpp.
References getCatalog(), and Catalog_Namespace::Catalog::setTableEpochs().
|
private |
Definition at line 658 of file Importer.h.
Referenced by isAddingColumns(), and setAddingColumns().
|
protected |
Definition at line 627 of file Importer.h.
Referenced by distributeToShardsNewColumns(), dropColumns(), getCatalog(), init(), and loadImpl().
|
protected |
Definition at line 629 of file Importer.h.
Referenced by distributeToShardsExistingColumns(), get_column_descs(), and init().
|
protected |
Definition at line 632 of file Importer.h.
Referenced by getStringDict(), and init().
|
private |
Definition at line 660 of file Importer.h.
Referenced by getErrorMessage(), and loadToShard().
|
protected |
Definition at line 631 of file Importer.h.
Referenced by init(), and loadToShard().
|
protected |
Definition at line 630 of file Importer.h.
Referenced by loadImpl().
|
private |
Definition at line 659 of file Importer.h.
Referenced by loadToShard().
|
protected |
Definition at line 628 of file Importer.h.
Referenced by distributeToShards(), distributeToShardsExistingColumns(), distributeToShardsNewColumns(), dropColumns(), getTableDesc(), init(), and loadImpl().