CatapultServer  v0.5.0.1 (Elephant)
MongoBlockStorage.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "MongoStorageContext.h"
24 
25 namespace catapult {
26  namespace mongo {
27  class MongoReceiptRegistry;
28  class MongoTransactionRegistry;
29  }
30 }
31 
32 namespace catapult { namespace mongo {
33 
35  std::unique_ptr<io::LightBlockStorage> CreateMongoBlockStorage(
36  MongoStorageContext& context,
37  const MongoTransactionRegistry& transactionRegistry,
38  const MongoReceiptRegistry& receiptRegistry);
39 }}
RegisterMongoSubsystem
PLUGIN_API void RegisterMongoSubsystem(catapult::mongo::MongoPluginManager &manager)
Entry point for registering a dynamic module with manager.
Definition: MongoAggregatePlugin.cpp:26
CATAPULT_LOG
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
Height
catapult::Height Height
Definition: Harvester.cpp:46
MongoStorageContext.h
Parser.debug
def debug(*args)
Definition: Parser.py:46
catapult::mongo::MongoTransactionRegistry
A registry of mongo transaction plugins.
Definition: MongoTransactionPlugin.h:71
BlockStorage.h
catapult::mongo::plugins::CreateAggregateTransactionMongoPlugin
std::unique_ptr< MongoTransactionPlugin > CreateAggregateTransactionMongoPlugin(const MongoTransactionRegistry &transactionRegistry, model::EntityType transactionType)
Creates a mongo aggregate transaction plugin around transactionRegistry for transactions with type tr...
Definition: AggregateMapper.cpp:112
catapult::model
Definition: AddressExtractor.h:26
catapult::mongo::MongoPluginManager::addTransactionSupport
void addTransactionSupport(std::unique_ptr< MongoTransactionPlugin > &&pTransactionPlugin)
Adds support for a transaction described by pTransactionPlugin.
Definition: MongoPluginManager.h:53
catapult::mongo::TrySetChainInfoDocument
BulkWriteResult TrySetChainInfoDocument(mongocxx::database &database, const bsoncxx::document::view &upsertDoc)
Upserts the chain info document in database with upsertDoc.
Definition: MongoChainInfoUtils.cpp:29
m_errorPolicy
MongoErrorPolicy m_errorPolicy
Definition: MongoBlockStorage.cpp:243
catapult::mongo::MongoPluginManager::transactionRegistry
const MongoTransactionRegistry & transactionRegistry() const
Gets the transaction registry.
Definition: MongoPluginManager.h:70
m_database
MongoDatabase m_database
Definition: MongoBlockStorage.cpp:242
catapult::thread::when_all
future< std::vector< future< T > > > when_all(std::vector< future< T >> &&allFutures)
Returns a future that is signaled when all futures in allFutures complete.
Definition: FutureUtils.h:31
PLUGIN_API
#define PLUGIN_API
Definition: plugins.h:30
catapult::mongo::MongoPluginManager
A manager for registering mongo plugins.
Definition: MongoPluginManager.h:32
AggregateMapper.h
catapult::mongo::mappers::ToDbDocuments
std::vector< bsoncxx::document::value > ToDbDocuments(const model::Transaction &transaction, const MongoTransactionMetadata &metadata, const MongoTransactionRegistry &transactionRegistry)
Definition: TransactionMapper.cpp:73
MongoBlockStorage.h
forwardsValidation.info
def info(*args)
Definition: forwardsValidation.py:12
BlockMapper.h
MongoBulkWriter.h
MongoTransactionMetadata.h
catapult::mongo::MongoReceiptRegistry
A registry of mongo receipt plugins.
Definition: MongoReceiptPlugin.h:46
MongoPluginManager.h
TransactionStatementMapper.h
catapult::model::HashRange
EntityRange< Hash256 > HashRange
An entity range composed of hashes.
Definition: RangeTypes.h:35
catapult::mongo::plugins::ToDbModel
bsoncxx::document::value ToDbModel(const state::HashLockInfo &hashLockInfo, const Address &accountAddress)
Maps a hashLockInfo and accountAddress to the corresponding db model value.
Definition: HashLockInfoMapper.cpp:40
m_receiptRegistry
const MongoReceiptRegistry & m_receiptRegistry
Definition: MongoBlockStorage.cpp:241
catapult::mongo::mappers::GetUint64OrDefault
uint64_t GetUint64OrDefault(const bsoncxx::document::view &documentView, const char *name, uint64_t defaultValue)
Attempts to read a uint64 value from documentView with name, returning defaultValue if no such value ...
Definition: MapperUtils.cpp:54
CATAPULT_THROW_RUNTIME_ERROR
#define CATAPULT_THROW_RUNTIME_ERROR(MESSAGE)
Macro used to throw a catapult runtime error.
Definition: exceptions.h:167
HashMapper.h
AggregateEntityType.h
CATAPULT_THROW_INVALID_ARGUMENT
#define CATAPULT_THROW_INVALID_ARGUMENT(MESSAGE)
Macro used to throw a catapult invalid argument.
Definition: exceptions.h:179
TransactionMapper.h
catapult::mongo::GetChainInfoDocument
bsoncxx::document::value GetChainInfoDocument(const mongocxx::database &database)
Gets the chain info document from database.
Definition: MongoChainInfoUtils.cpp:35
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::mongo::MongoStorageContext
Context for creating a mongo storage.
Definition: MongoStorageContext.h:30
m_transactionRegistry
const MongoTransactionRegistry & m_transactionRegistry
Definition: MongoBlockStorage.cpp:240
MongoChainInfoUtils.h
ResolutionStatementMapper.h
catapult::mongo::CreateMongoBlockStorage
std::unique_ptr< io::LightBlockStorage > CreateMongoBlockStorage(MongoStorageContext &context, const MongoTransactionRegistry &transactionRegistry, const MongoReceiptRegistry &receiptRegistry)
Creates a mongodb block storage around context, transactionRegistry and receiptRegistry.
Definition: MongoBlockStorage.cpp:247
catapult::mongo::mappers::ToModel
model::HashRange ToModel(mongocxx::cursor &cursor, size_t numHashes)
Maps numHashes db hashes under cursor to a hash range.
Definition: HashMapper.cpp:47
MongoReceiptPlugin.h
catapult::mongo::mappers::IsEmptyDocument
bool IsEmptyDocument(const bsoncxx::document::value &document)
Returns true if document is empty.
Definition: MapperUtils.cpp:62
catapult::thread::get_all
std::vector< T > get_all(std::vector< future< T >> &&futures)
Definition: FutureUtils.h:141
m_context
MongoStorageContext & m_context
Definition: MongoBlockStorage.cpp:239