1 #ifndef _CONNECTION_MANAGER_H 2 #define _CONNECTION_MANAGER_H 13 #include <plugin_api.h> 32 void setError(
const char *,
const char *,
bool);
38 void setVacuumInterval(
long hours) {
39 m_vacuumInterval = 60 * 60 * hours;
41 void setPersist(
bool persist,
const std::string& filename =
"")
44 m_filename = filename;
46 bool persist() {
return m_persist; };
47 std::string filename() {
return m_filename; };
55 std::list<Connection *> idle;
56 std::list<Connection *> inUse;
63 std::thread *m_background;
64 long m_vacuumInterval;
66 std::string m_filename;
67 unsigned long m_purgeBlockSize;
void growPool(unsigned int)
Grow the connection pool by the number of connections specified.
Definition: connection_manager.cpp:59
unsigned int shrinkPool(unsigned int)
Attempt to shrink the number of connections in the idle pool.
Definition: connection_manager.cpp:82
Connection * allocate()
Allocate a connection from the idle pool.
Definition: connection_manager.cpp:110
Singleton class to manage Postgres connection pool.
Definition: connection_manager.h:22
void shutdown()
Called at shutdown.
Definition: connection_manager.cpp:35
static ConnectionManager * getInstance()
Return the singleton instance of the connection manager.
Definition: connection_manager.cpp:44
void release(Connection *)
Release a connection back to the idle pool for reallocation.
Definition: connection_manager.cpp:142
void background()
Background thread used to execute periodic tasks and oversee the database activity.
Definition: connection_manager.cpp:535
void setError(const char *, const char *, bool)
Set the last error information for a plugin.
Definition: connection_manager.cpp:159
A class to monitor the free disk space used to store the various storage databases.
Definition: disk_monitor.h:22
void setPurgeBlockSize(unsigned long purgeBlockSize)
Set the purge block size in each of the connections.
Definition: connection_manager.cpp:102
Definition: connection.h:32
Structure used by plugins to return error information.
Definition: plugin_api.h:44