Do WAL checkpointing in our own thread(s).

This commit is contained in:
JoelKatz
2013-01-11 18:45:16 -08:00
parent b21e751ce7
commit 0d49bc877e
4 changed files with 80 additions and 1 deletions

View File

@@ -1,13 +1,24 @@
#include "database.h"
#include <string>
#include <set>
#include <boost/thread/mutex.hpp>
struct sqlite3;
struct sqlite3_stmt;
class SqliteDatabase : public Database
{
sqlite3* mConnection;
sqlite3_stmt* mCurrentStmt;
bool mMoreRows;
boost::mutex walMutex;
std::set<std::string> walDBs;
bool walRunning;
public:
SqliteDatabase(const char* host);
@@ -38,6 +49,12 @@ public:
int getBinary(int colIndex,unsigned char* buf,int maxSize);
std::vector<unsigned char> getBinary(int colIndex);
uint64 getBigInt(int colIndex);
sqlite3* peekConnection() { return mConnection; }
virtual bool setupCheckpointing();
void runWal();
void doHook(const char *db, int walSize);
};
// vim:ts=4