Class DBManager

Class Documentation

class DBManager

Class that manages all DB attached to AMS workflows. Each DB can overload its method close() that will get called by the DB manager when the last workflow using a DB will be destructed.

Public Functions

inline ~DBManager()
DBManager(const DBManager&) = delete
DBManager(DBManager&&) = delete
DBManager &operator=(const DBManager&) = delete
DBManager &operator=(DBManager&&) = delete
inline bool isInitialized() const
inline std::shared_ptr<BaseDB> createDB(std::string &domainName, AMSDBType dbType, uint64_t rId = 0)

Create an object of the respective database. This should never be used for large scale simulations as txt/csv format will be extremely slow.

Parameters:
  • domainName[in] name of the domain model to store data for

  • dbType[in] Type of the database to create

  • rId[in] a unique Id for each process taking part in a distributed execution (rank-id)

inline std::shared_ptr<BaseDB> getDB(std::string &domainName, uint64_t rId = 0)

get a data base object referred by this string. This should never be used for large scale simulations as txt/csv format will be extremely slow.

Parameters:
  • domainName[in] name of the domain model to store data for.

  • rId[in] a unique Id for each process taking part in a distributed execution (rank-id)

inline void dropDB(std::string &domainName, uint64_t rId = 0)
inline void instantiate_fs_db(AMSDBType type, std::string db_path, bool is_debug = false)
inline void instantiate_rmq_db(int port, std::string &host, std::string &rmq_pass, std::string &rmq_user, std::string &rmq_vhost, std::string &rmq_cert, std::string &outbound_queue, std::string &exchange, std::string &routing_key, bool update_surrogate)
inline size_t getNumInstances() const
inline void clean()

Public Static Functions

static inline auto &getInstance()

Protected Attributes

RMQInterface rmq_interface
FilesystemInterface fs_interface