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

@@ -1740,6 +1740,9 @@
<ClCompile Include="..\..\src\snappy\snappy.unity.cpp">
<Filter>[0] Libraries\snappy</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\common\tests\cross_offer.test.cpp">
<Filter>[1] Ripple\common\tests</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\ripple_basics\containers\RangeSet.h">

File diff suppressed because it is too large Load Diff

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"