Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 34 lines (29 sloc) 1.097 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#include "config.h"

#include <string>
#include <map>

#include "common.hh"
#include "ep_engine.h"
#include "stats.hh"
#include "kvstore.hh"
#include "sqlite-kvstore/sqlite-kvstore.hh"
#include "mc-kvstore/mc-kvstore.hh"
#include "blackhole-kvstore/blackhole.hh"
#include "leveldb-kvstore/leveldb-kvstore.hh"

KVStore *KVStoreFactory::create(EventuallyPersistentEngine &theEngine) {
    Configuration &c = theEngine.getConfiguration();

    std::string backend = c.getBackend();
    if (backend.compare("sqlite") == 0) {
        return SqliteKVStoreFactory::create(theEngine);
    } else if (backend.compare("couchdb") == 0) {
        return new MCKVStore(theEngine);
    } else if (backend.compare("blackhole") == 0) {
        return new BlackholeKVStore(theEngine);
    } else if (backend.compare("leveldb") == 0) {
        return new LevelDBKVStore(theEngine);
    } else {
        getLogger()->log(EXTENSION_LOG_WARNING, NULL, "Unknown backend: [%s]",
                backend.c_str());
    }

    return NULL;
}
Something went wrong with that request. Please try again.