21#ifndef DBServer_MySQL_H_
22#define DBServer_MySQL_H_
24#include <unordered_map>
26#include "UniSetTypes.h"
27#include "MySQLInterface.h"
161 static std::shared_ptr<DBServer_MySQL>
init_dbserver(
int argc,
const char*
const* argv,
const std::string& prefix =
"mysql" );
164 static void help_print(
int argc,
const char*
const* argv );
166 inline std::shared_ptr<LogAgregator> logAggregator()
170 inline std::shared_ptr<DebugStream> log()
176 typedef std::unordered_map<int, std::string> DBTableMap;
178 virtual void initDBServer()
override;
179 virtual void onReconnect(
const std::unique_ptr<MySQLInterface>& db ) {};
186 virtual std::string getMonitInfo(
const std::string& params )
override;
188 bool writeToBase(
const std::string& query );
190 inline std::string tblName(
int key )
192 return tblMap[
key].c_str();
202 std::unique_ptr<MySQLInterface> db;
203 int PingTime = { 15000 };
204 int ReconnectTime = { 30000 };
205 bool connect_ok = {
false };
209 typedef std::queue<std::string> QueryBuffer;
212 size_t qbufSize = { 200 };
213 bool lastRemove = {
false };
Definition MessageType.h:240
Definition DBServer_MySQL.h:154
static void help_print(int argc, const char *const *argv)
Definition DBServer_MySQL.cc:434
Timers
Definition DBServer_MySQL.h:196
@ PingTimer
Definition DBServer_MySQL.h:197
@ ReconnectTimer
Definition DBServer_MySQL.h:198
static std::shared_ptr< DBServer_MySQL > init_dbserver(int argc, const char *const *argv, const std::string &prefix="mysql")
Definition DBServer_MySQL.cc:411
bool activate
Definition DBServer_MySQL.h:207
Definition MessageType.h:127
Definition MessageType.h:171
Definition MessageType.h:283
Definition MessageType.h:214
Definition Calibration.h:27
KeyType key(const uniset::ObjectId id, const uniset::ObjectId node)
Definition UniSetTypes.cc:980
long ObjectId
Definition UniSetTypes_i.idl:30