Enable Snappy compression for NodeStore backends.

* Configured via config.cfg
This commit is contained in:
Miguel Portilla
2014-05-06 12:53:50 -04:00
committed by Vinnie Falco
parent 83ef06748d
commit be737e0047
5 changed files with 897 additions and 876 deletions

View File

@@ -71,6 +71,14 @@ public:
options.max_open_files = keyValues["open_files"].getIntValue();
}
if (! keyValues["compression"].isEmpty ())
{
if (keyValues["compression"].getIntValue () == 0)
{
options.compression = leveldb::kNoCompression;
}
}
leveldb::DB* db = nullptr;
leveldb::Status status = leveldb::DB::Open (options, m_name, &db);
if (!status.ok () || !db)

View File

@@ -155,6 +155,14 @@ public:
options.max_background_flushes = highThreads;
}
if (! keyValues["compression"].isEmpty ())
{
if (keyValues["compression"].getIntValue () == 0)
{
options.compression = rocksdb::kNoCompression;
}
}
rocksdb::DB* db = nullptr;
rocksdb::Status status = rocksdb::DB::Open (options, m_name, &db);
if (!status.ok () || !db)

View File

@@ -20,6 +20,7 @@
#ifndef RIPPLE_LEVELDB_H_INCLUDED
#define RIPPLE_LEVELDB_H_INCLUDED
#define SNAPPY
#include "leveldb/cache.h"
#include "leveldb/filter_policy.h"
#include "leveldb/db.h"