mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Enable Snappy compression for NodeStore backends.
* Configured via config.cfg
This commit is contained in:
committed by
Vinnie Falco
parent
83ef06748d
commit
be737e0047
@@ -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">
|
||||
|
||||
@@ -675,6 +675,7 @@
|
||||
# Examples:
|
||||
# type=HyperLevelDB
|
||||
# path=db/hyperldb
|
||||
# compression=0
|
||||
#
|
||||
# Choices for 'type' (not case-sensitive)
|
||||
# HyperLevelDB Use an improved version of LevelDB (preferred)
|
||||
@@ -687,7 +688,7 @@
|
||||
# path Location to store the database (all types)
|
||||
#
|
||||
# Optional keys:
|
||||
# (none yet)
|
||||
# compression 0 for none, 1 for Snappy compression
|
||||
#
|
||||
# Notes:
|
||||
# The 'node_db' entry configures the primary, persistent storage.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user