CatapultServer
v0.5.0.1 (Elephant)
|
Classes | |
struct | BulkWriteContext |
struct | BulkWriteParams |
Public Member Functions | |
template<typename TContainer > | |
BulkWriteResultFuture | bulkInsert (const std::string &collectionName, const TContainer &entities, const CreateDocument< typename TContainer::value_type > &createDocument) |
template<typename TContainer > | |
BulkWriteResultFuture | bulkInsert (const std::string &collectionName, const TContainer &entities, const CreateDocuments< typename TContainer::value_type > &createDocuments) |
template<typename TContainer > | |
BulkWriteResultFuture | bulkUpsert (const std::string &collectionName, const TContainer &entities, const CreateDocument< typename TContainer::value_type > &createDocument, const CreateFilter< typename TContainer::value_type > &createFilter) |
template<typename TContainer > | |
BulkWriteResultFuture | bulkDelete (const std::string &collectionName, const TContainer &entities, const CreateFilter< typename TContainer::value_type > &createFilter) |
Deletes entities from the collection named collectionName matching the specified entity filter (createFilter). More... | |
Static Public Member Functions | |
static std::shared_ptr< MongoBulkWriter > | Create (const mongocxx::uri &uri, const std::string &dbName, const std::shared_ptr< thread::IoThreadPool > &pPool) |
Private Types | |
using | AccountStates = std::unordered_set< std::shared_ptr< const state::AccountState > > |
using | BulkWriteResultFuture = thread::future< std::vector< thread::future< BulkWriteResult > >> |
template<typename TEntity > | |
using | AppendOperation = consumer< mongocxx::bulk_write &, const TEntity &, uint32_t > |
template<typename TEntity > | |
using | CreateDocument = std::function< bsoncxx::document::value(const TEntity &, uint32_t)> |
template<typename TEntity > | |
using | CreateDocuments = std::function< std::vector< bsoncxx::document::value >(const TEntity &, uint32_t)> |
template<typename TEntity > | |
using | CreateFilter = std::function< bsoncxx::document::value(const TEntity &)> |
Private Member Functions | |
MongoBulkWriter (const mongocxx::uri &uri, const std::string &dbName, const std::shared_ptr< thread::IoThreadPool > &pPool) | |
thread::future< BulkWriteResult > | handleBulkOperation (std::shared_ptr< BulkWriteParams > &&pBulkWriteParams) |
void | bulkWrite (BulkWriteParams &bulkWriteParams, thread::promise< BulkWriteResult > &promise) |
template<typename TEntity , typename TContainer > | |
BulkWriteResultFuture | bulkWrite (const std::string &collectionName, const TContainer &entities, const AppendOperation< typename TContainer::value_type > &appendOperation) |
Private Attributes | |
std::string | m_dbName |
std::shared_ptr< const thread::IoThreadPool > | m_pPool |
boost::asio::io_context & | m_ioContext |
mongocxx::pool | m_connectionPool |
Class for writing bulk data to the mongo database.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
inlineprivate |
|
inline |
Deletes entities from the collection named collectionName matching the specified entity filter (createFilter).
|
inline |
Inserts entities into the collection named collectionName using a one-to-one mapping of entities to documents (createDocument).
|
inline |
Inserts entities into the collection named collectionName using a one-to-many mapping of entities to documents (createDocuments).
|
inline |
Upserts entities into the collection named collectionName using a one-to-one mapping of entities to documents (createDocument) matching the specified entity filter (createFilter).
|
inlineprivate |
|
inlineprivate |
|
inlinestatic |
Creates a mongo bulk writer connected to uri that will use database dbName for bulk writes.
|
inlineprivate |
|
private |
|
private |
|
private |
|
private |