1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-17 01:02:23 +03:00

Check pointing some changes I made all over the place

working on Synchronizer.  Won't build yet.
This commit is contained in:
Patrick LeBlanc
2019-03-11 16:09:07 -05:00
parent 13ade9e724
commit 9906ff9efb
12 changed files with 267 additions and 11 deletions

View File

@@ -3,8 +3,16 @@
#define SYNCHRONIZER_H_
#include <string>
#include <map>
#include <deque>
#include <boost/utility.hpp>
#include "SMLogging.h"
#include "Cache.h"
#include "Replicator.h"
#include "IOCoordinator.h"
#include "ThreadPool.h"
namespace storagemanager
{
@@ -14,10 +22,41 @@ class Synchronizer : public boost::noncopyable
static Synchronizer *get();
virtual ~Synchronizer();
void newJournalEntry(const std::string &key);
void newObjects(const std::vector<std::string> &keys);
void deletedObjects(const std::vector<std::string> &keys);
void flushObject(const std::string &key);
private:
Synchronizer();
struct FlushListener
{
FlushListener(boost::mutex *m, boost::condvar *c);
boost::mutex *mutex;
boost::condition *condvar;
void flushed();
}
struct PendingOps
{
PendingOps(int flags, std::list<std::string>::iterator pos);
int opFlags;
bool finished;
std::list<std::string>::iterator queueEntry;
boost::condition condvar;
void wait();
void notify();
};
ThreadPool threadPool;
std::map<std::string, boost::shared_ptr<PendingOps> > pendingOps;
std::list<std::string> workQueue;
SMLogging *logger;
Cache *cache;
Replicator *replicator;
IOCoordinator *ioc;
boost::mutex mutex;
};
}