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">
|
<ClCompile Include="..\..\src\snappy\snappy.unity.cpp">
|
||||||
<Filter>[0] Libraries\snappy</Filter>
|
<Filter>[0] Libraries\snappy</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\src\ripple\common\tests\cross_offer.test.cpp">
|
||||||
|
<Filter>[1] Ripple\common\tests</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\src\ripple_basics\containers\RangeSet.h">
|
<ClInclude Include="..\..\src\ripple_basics\containers\RangeSet.h">
|
||||||
|
|||||||
@@ -675,6 +675,7 @@
|
|||||||
# Examples:
|
# Examples:
|
||||||
# type=HyperLevelDB
|
# type=HyperLevelDB
|
||||||
# path=db/hyperldb
|
# path=db/hyperldb
|
||||||
|
# compression=0
|
||||||
#
|
#
|
||||||
# Choices for 'type' (not case-sensitive)
|
# Choices for 'type' (not case-sensitive)
|
||||||
# HyperLevelDB Use an improved version of LevelDB (preferred)
|
# HyperLevelDB Use an improved version of LevelDB (preferred)
|
||||||
@@ -687,7 +688,7 @@
|
|||||||
# path Location to store the database (all types)
|
# path Location to store the database (all types)
|
||||||
#
|
#
|
||||||
# Optional keys:
|
# Optional keys:
|
||||||
# (none yet)
|
# compression 0 for none, 1 for Snappy compression
|
||||||
#
|
#
|
||||||
# Notes:
|
# Notes:
|
||||||
# The 'node_db' entry configures the primary, persistent storage.
|
# The 'node_db' entry configures the primary, persistent storage.
|
||||||
|
|||||||
@@ -71,6 +71,14 @@ public:
|
|||||||
options.max_open_files = keyValues["open_files"].getIntValue();
|
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::DB* db = nullptr;
|
||||||
leveldb::Status status = leveldb::DB::Open (options, m_name, &db);
|
leveldb::Status status = leveldb::DB::Open (options, m_name, &db);
|
||||||
if (!status.ok () || !db)
|
if (!status.ok () || !db)
|
||||||
|
|||||||
@@ -155,6 +155,14 @@ public:
|
|||||||
options.max_background_flushes = highThreads;
|
options.max_background_flushes = highThreads;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! keyValues["compression"].isEmpty ())
|
||||||
|
{
|
||||||
|
if (keyValues["compression"].getIntValue () == 0)
|
||||||
|
{
|
||||||
|
options.compression = rocksdb::kNoCompression;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rocksdb::DB* db = nullptr;
|
rocksdb::DB* db = nullptr;
|
||||||
rocksdb::Status status = rocksdb::DB::Open (options, m_name, &db);
|
rocksdb::Status status = rocksdb::DB::Open (options, m_name, &db);
|
||||||
if (!status.ok () || !db)
|
if (!status.ok () || !db)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#ifndef RIPPLE_LEVELDB_H_INCLUDED
|
#ifndef RIPPLE_LEVELDB_H_INCLUDED
|
||||||
#define RIPPLE_LEVELDB_H_INCLUDED
|
#define RIPPLE_LEVELDB_H_INCLUDED
|
||||||
|
|
||||||
|
#define SNAPPY
|
||||||
#include "leveldb/cache.h"
|
#include "leveldb/cache.h"
|
||||||
#include "leveldb/filter_policy.h"
|
#include "leveldb/filter_policy.h"
|
||||||
#include "leveldb/db.h"
|
#include "leveldb/db.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user