#include <DatabaseInserter.hpp>
Definition at line 44 of file DatabaseInserter.hpp.
Public Member Functions | |
| DatabaseInserter (void) | |
| constructs a new DatabaseInserter object | |
| virtual | ~DatabaseInserter () |
| virtual destructor: this class may be extended | |
| void | setDatabaseManager (DatabaseManager &mgr) |
| sets the DatabaseManager that will used by the plugin to access Databases | |
| void | setConfig (const Vocabulary &v, const xmlNodePtr config_ptr) |
| void | updateVocabulary (const Vocabulary &v) |
| void | updateDatabases (void) |
| void | insert (const EventPtr &e) |
| void | start (void) |
| void | stop (void) |
| stops the worker thread used to insert records | |
| std::size_t | getEventsQueued (void) const |
| returns the total number of events queued | |
| std::size_t | getKeyCacheSize (void) const |
| returns the total number of items in the key cache | |
| const std::string & | getDatabaseId (void) const |
| returns the unique identifier for the database being used | |
| DatabasePtr | getDatabasePtr (void) |
| returns the DatabasePtr (for queries) | |
| const std::string & | getTableName (void) const |
| returns the name of the database table that events are inserted into | |
| bool | setTableName (const std::string &name) |
| sets (overrides) the table name; must be called before start() | |
| bool | setPartition (unsigned partition) |
| set partition number -- must be called before start() | |
| bool | setWipe (bool wipe) |
| Wipe out existing database before opening? | |
| boost::uint32_t | getRotate (void) const |
| boost::uint64_t | getTableSize (void) const |
| Query::FieldMap | getFieldMap (void) const |
| returns a copy of the mapping of database fields to event terms | |
| Query::IndexMap | getIndexMap (void) const |
| returns a copy of the index map | |
| bool | isRunning (void) const |
| returns true if the worker thread is running | |
| void | setLogger (PionLogger log_ptr) |
| sets the logger to be used | |
| PionLogger | getLogger (void) |
| returns the logger currently in use | |
| bool | tableExists (void) |
| does table exist (table name, and partition must be already configured) | |
Classes | |
| class | DuplicateColumnName |
| exception thrown if the DatabaseInserter configuration has a duplicate field name More... | |
| class | EmptyDatabaseException |
| exception thrown if the DatabaseInserter configuration does not define a Database More... | |
| class | EmptyFieldException |
| exception thrown if the DatabaseInserter configuration includes an empty field name More... | |
| class | EmptyTableException |
| exception thrown if the DatabaseInserter configuration does not define a Table More... | |
| class | EmptyTermException |
| exception thrown if the DatabaseInserter configuration does not define a term in a field mapping More... | |
| class | IllegalCharactersException |
| exception thrown if the DatabaseInserter configuration has a field name with illegal characters More... | |
| class | MissingDatabaseManagerException |
| class | MissingEventTime |
| exception thrown if the DatabaseInserter is configured to keep a key cache, with age, but age term is not defined More... | |
| class | NoFieldsException |
| exception thrown if there are no database field mappings in the configuration More... | |
| class | NoUniqueKeyFound |
| exception thrown if the DatabaseInserter configuration has a field name with illegal characters More... | |
| class | UnknownTermException |
| exception thrown if the DatabaseInserter configuration uses an unknown term in a field mapping More... | |
| void pion::platform::DatabaseInserter::insert | ( | const EventPtr & | e | ) |
adds an event to the queue for database insertion
| e | pointer to the Event to insert |
Definition at line 297 of file DatabaseInserter.cpp.
References pion::platform::Vocabulary::TYPE_BLOB, pion::platform::Vocabulary::TYPE_CHAR, pion::platform::Vocabulary::TYPE_DATE, pion::platform::Vocabulary::TYPE_DATE_TIME, pion::platform::Vocabulary::TYPE_DOUBLE, pion::platform::Vocabulary::TYPE_FLOAT, pion::platform::Vocabulary::TYPE_INT16, pion::platform::Vocabulary::TYPE_INT32, pion::platform::Vocabulary::TYPE_INT64, pion::platform::Vocabulary::TYPE_INT8, pion::platform::Vocabulary::TYPE_LONG_DOUBLE, pion::platform::Vocabulary::TYPE_LONG_STRING, pion::platform::Vocabulary::TYPE_NULL, pion::platform::Vocabulary::TYPE_OBJECT, pion::platform::Vocabulary::TYPE_SHORT_STRING, pion::platform::Vocabulary::TYPE_STRING, pion::platform::Vocabulary::TYPE_TIME, pion::platform::Vocabulary::TYPE_UINT16, pion::platform::Vocabulary::TYPE_UINT32, pion::platform::Vocabulary::TYPE_UINT64, pion::platform::Vocabulary::TYPE_UINT8, and pion::platform::Vocabulary::TYPE_ZBLOB.
| void pion::platform::DatabaseInserter::setConfig | ( | const Vocabulary & | v, | |
| const xmlNodePtr | config_ptr | |||
| ) |
sets configuration parameters for this class
| v | the Vocabulary that this class will use to describe Terms | |
| config_ptr | pointer to a list of XML nodes containing class configuration parameters |
Definition at line 50 of file DatabaseInserter.cpp.
References pion::platform::ConfigManager::findConfigNodeByName(), pion::platform::Vocabulary::findTerm(), pion::platform::ConfigManager::getAttribute(), pion::platform::ConfigManager::getConfigOption(), pion::platform::RuleChain::setConfig(), start(), stop(), and pion::platform::Vocabulary::UNDEFINED_TERM_REF.
| void pion::platform::DatabaseInserter::start | ( | void | ) |
starts the worker thread used to insert records. NOTE: you must call setDatabaseManager() before starting the DatabaseInserter!
Definition at line 193 of file DatabaseInserter.cpp.
References pion::platform::DatabaseManager::getDatabase().
Referenced by setConfig().
| void pion::platform::DatabaseInserter::updateDatabases | ( | void | ) |
this updates the Databases that are used by this class; it should be called whenever any Database's configuration is updated
Definition at line 185 of file DatabaseInserter.cpp.
References stop().
| void pion::platform::DatabaseInserter::updateVocabulary | ( | const Vocabulary & | v | ) |
this updates the Vocabulary information used by this class; it should be called whenever the global Vocabulary is updated
| v | the Vocabulary that this class will use to describe Terms |
Definition at line 170 of file DatabaseInserter.cpp.
1.4.7