Don't set default compression as it forces us to require the compression library when linking or at runtime. Let RocksBb pick the best default. (#41)
This commit is contained in:
parent
90027f1875
commit
f37d7d486c
|
@ -35,7 +35,7 @@ proc setCreateMissingColumnFamilies*(cfOpts: ColFamilyOptionsRef, flag: bool) =
|
||||||
proc defaultColFamilyOptions*(): ColFamilyOptionsRef =
|
proc defaultColFamilyOptions*(): ColFamilyOptionsRef =
|
||||||
let opts = newColFamilyOptions()
|
let opts = newColFamilyOptions()
|
||||||
|
|
||||||
rocksdb_options_set_compression(opts.cPtr, rocksdb_lz4_compression)
|
# rocksdb_options_set_compression(opts.cPtr, rocksdb_lz4_compression)
|
||||||
# rocksdb_options_set_bottommost_compression(opts.cPtr, rocksdb_zstd_compression)
|
# rocksdb_options_set_bottommost_compression(opts.cPtr, rocksdb_zstd_compression)
|
||||||
|
|
||||||
# Enable creating column families if they do not exist
|
# Enable creating column families if they do not exist
|
||||||
|
|
|
@ -120,15 +120,12 @@ when defined(rocksdb_static_linking):
|
||||||
topLevelPath = currentSourcePath.parentDir().parentDir().parentDir()
|
topLevelPath = currentSourcePath.parentDir().parentDir().parentDir()
|
||||||
libsDir = topLevelPath.replace('\\', '/') & "/build/lib"
|
libsDir = topLevelPath.replace('\\', '/') & "/build/lib"
|
||||||
|
|
||||||
|
{.passL: libsDir & "/librocksdb.a".}
|
||||||
|
{.passL: libsDir & "/liblz4.a".}
|
||||||
|
{.passL: libsDir & "/libzstd.a".}
|
||||||
|
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
{.passL: "-lshlwapi -lrpcrt4".}
|
{.passL: "-lshlwapi -lrpcrt4".}
|
||||||
{.passL: libsDir & "/rocksdb.lib".}
|
|
||||||
{.passL: libsDir & "/lz4.lib".}
|
|
||||||
{.passL: libsDir & "/zstd.lib".}
|
|
||||||
else:
|
|
||||||
{.passL: libsDir & "/librocksdb.a".}
|
|
||||||
{.passL: libsDir & "/liblz4.a".}
|
|
||||||
{.passL: libsDir & "/libzstd.a".}
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
when shouldUseNativeLinking():
|
when shouldUseNativeLinking():
|
||||||
|
|
|
@ -32,7 +32,7 @@ proc cPtr*(engineOpts: BackupEngineOptionsRef): BackupEngineOptionsPtr =
|
||||||
|
|
||||||
proc defaultBackupEngineOptions*(): BackupEngineOptionsRef {.inline.} =
|
proc defaultBackupEngineOptions*(): BackupEngineOptionsRef {.inline.} =
|
||||||
let opts = newBackupEngineOptions()
|
let opts = newBackupEngineOptions()
|
||||||
rocksdb_options_set_compression(opts.cPtr, rocksdb_lz4_compression)
|
# rocksdb_options_set_compression(opts.cPtr, rocksdb_lz4_compression)
|
||||||
# rocksdb_options_set_bottommost_compression(opts.cPtr, rocksdb_zstd_compression)
|
# rocksdb_options_set_bottommost_compression(opts.cPtr, rocksdb_zstd_compression)
|
||||||
opts
|
opts
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ proc setCreateMissingColumnFamilies*(dbOpts: DbOptionsRef, flag: bool) =
|
||||||
proc defaultDbOptions*(): DbOptionsRef =
|
proc defaultDbOptions*(): DbOptionsRef =
|
||||||
let opts: DbOptionsRef = newDbOptions()
|
let opts: DbOptionsRef = newDbOptions()
|
||||||
|
|
||||||
rocksdb_options_set_compression(opts.cPtr, rocksdb_lz4_compression)
|
# rocksdb_options_set_compression(opts.cPtr, rocksdb_lz4_compression)
|
||||||
# rocksdb_options_set_bottommost_compression(opts.cPtr, rocksdb_zstd_compression)
|
# rocksdb_options_set_bottommost_compression(opts.cPtr, rocksdb_zstd_compression)
|
||||||
|
|
||||||
# Optimize RocksDB. This is the easiest way to get RocksDB to perform well:
|
# Optimize RocksDB. This is the easiest way to get RocksDB to perform well:
|
||||||
|
|
Loading…
Reference in New Issue