@nxtedition/rocksdb 13.0.0 → 13.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/binding.cc CHANGED
@@ -885,6 +885,9 @@ napi_status InitOptions(napi_env env, T& columnOptions, const U& options) {
885
885
  }
886
886
  }
887
887
 
888
+ columnOptions.optimize_filters_for_hits = false;
889
+ NAPI_STATUS_RETURN(GetProperty(env, options, "optimizeFiltersForHits", columnOptions.optimize_filters_for_hits));
890
+
888
891
  uint32_t cacheSize = 8 << 20;
889
892
  NAPI_STATUS_RETURN(GetProperty(env, options, "cacheSize", cacheSize));
890
893
 
@@ -892,11 +895,8 @@ napi_status InitOptions(napi_env env, T& columnOptions, const U& options) {
892
895
 
893
896
  if (cacheSize) {
894
897
  tableOptions.block_cache = rocksdb::HyperClockCacheOptions(cacheSize, 0).MakeSharedCache();
895
- NAPI_STATUS_RETURN(
896
- GetProperty(env, options, "cacheIndexAndFilterBlocks", tableOptions.cache_index_and_filter_blocks));
897
898
  } else {
898
899
  tableOptions.no_block_cache = true;
899
- tableOptions.cache_index_and_filter_blocks = false;
900
900
  }
901
901
 
902
902
  std::string optimize = "";
@@ -905,7 +905,7 @@ napi_status InitOptions(napi_env env, T& columnOptions, const U& options) {
905
905
  if (optimize == "point-lookup") {
906
906
  tableOptions.data_block_index_type = rocksdb::BlockBasedTableOptions::kDataBlockBinaryAndHash;
907
907
  tableOptions.data_block_hash_table_util_ratio = 0.75;
908
- tableOptions.filter_policy.reset(rocksdb::NewRibbonFilterPolicy(10, 1));
908
+ tableOptions.filter_policy.reset(rocksdb::NewRibbonFilterPolicy(10, 2));
909
909
 
910
910
  columnOptions.memtable_prefix_bloom_size_ratio = 0.02;
911
911
  columnOptions.memtable_whole_key_filtering = true;
@@ -915,9 +915,6 @@ napi_status InitOptions(napi_env env, T& columnOptions, const U& options) {
915
915
  tableOptions.filter_policy.reset(rocksdb::NewBloomFilterPolicy(10));
916
916
  }
917
917
 
918
- tableOptions.enable_index_compression = false;
919
- NAPI_STATUS_RETURN(GetProperty(env, options, "enableIndexCompression", tableOptions.enable_index_compression));
920
-
921
918
  std::optional<std::string> filterPolicyOpt;
922
919
  NAPI_STATUS_RETURN(GetProperty(env, options, "filterPolicy", filterPolicyOpt));
923
920
  if (filterPolicyOpt) {
@@ -925,11 +922,20 @@ napi_status InitOptions(napi_env env, T& columnOptions, const U& options) {
925
922
  rocksdb::FilterPolicy::CreateFromString(configOptions, *filterPolicyOpt, &tableOptions.filter_policy));
926
923
  }
927
924
 
925
+ tableOptions.block_size = 4 * 1024;
928
926
  NAPI_STATUS_RETURN(GetProperty(env, options, "blockSize", tableOptions.block_size));
929
927
 
928
+ tableOptions.block_restart_interval = 16;
930
929
  NAPI_STATUS_RETURN(GetProperty(env, options, "blockRestartInterval", tableOptions.block_restart_interval));
931
930
 
932
- tableOptions.checksum = rocksdb::kXXH3;
931
+ tableOptions.block_align = false;
932
+ NAPI_STATUS_RETURN(GetProperty(env, options, "blockAlign", tableOptions.block_align));
933
+
934
+ tableOptions.cache_index_and_filter_blocks = true; // false
935
+ NAPI_STATUS_RETURN(GetProperty(env, options, "cacheIndexAndFilterBlocks", tableOptions.cache_index_and_filter_blocks));
936
+
937
+ tableOptions.cache_index_and_filter_blocks_with_high_priority = true;
938
+ NAPI_STATUS_RETURN(GetProperty(env, options, "cacheIndexAndFilterBlocksWithHighPriority", tableOptions.cache_index_and_filter_blocks_with_high_priority));
933
939
 
934
940
  tableOptions.decouple_partitioned_filters = true;
935
941
  NAPI_STATUS_RETURN(GetProperty(env, options, "decouplePartitionedFilters", tableOptions.block_restart_interval));
@@ -937,12 +943,12 @@ napi_status InitOptions(napi_env env, T& columnOptions, const U& options) {
937
943
  tableOptions.optimize_filters_for_memory = true;
938
944
  NAPI_STATUS_RETURN(GetProperty(env, options, "optimizeFiltersForMemory", tableOptions.optimize_filters_for_memory));
939
945
 
940
- tableOptions.enable_index_compression = false;
941
- NAPI_STATUS_RETURN(GetProperty(env, options, "enableIndexCompression", tableOptions.enable_index_compression));
942
-
943
946
  tableOptions.max_auto_readahead_size = 256 * 1024;
944
947
  NAPI_STATUS_RETURN(GetProperty(env, options, "maxAutoReadaheadSize", tableOptions.max_auto_readahead_size));
945
948
 
949
+ tableOptions.num_file_reads_for_auto_readahead = 2;
950
+ NAPI_STATUS_RETURN(GetProperty(env, options, "numFileReadsForAutoReadahead", tableOptions.num_file_reads_for_auto_readahead));
951
+
946
952
  columnOptions.table_factory.reset(rocksdb::NewBlockBasedTableFactory(tableOptions));
947
953
 
948
954
  return napi_ok;
@@ -995,9 +1001,7 @@ NAPI_METHOD(db_open) {
995
1001
  NAPI_STATUS_THROWS(GetProperty(env, options, "walSizeLimit", walSizeLimit));
996
1002
  dbOptions.WAL_size_limit_MB = walSizeLimit / 1e6;
997
1003
 
998
- uint32_t maxTotalWalSize = 0;
999
- NAPI_STATUS_THROWS(GetProperty(env, options, "walTotalSizeLimit", walSizeLimit));
1000
- dbOptions.max_total_wal_size = maxTotalWalSize / 1e6;
1004
+ NAPI_STATUS_THROWS(GetProperty(env, options, "maxTotalWalSize", dbOptions.max_total_wal_size));
1001
1005
 
1002
1006
  bool walCompression = true;
1003
1007
  NAPI_STATUS_THROWS(GetProperty(env, options, "walCompression", walCompression));
@@ -1019,9 +1023,6 @@ NAPI_METHOD(db_open) {
1019
1023
  dbOptions.advise_random_on_open = true;
1020
1024
  NAPI_STATUS_THROWS(GetProperty(env, options, "adviseRandomOnOpen", dbOptions.advise_random_on_open));
1021
1025
 
1022
- dbOptions.optimize_filters_for_hits = false;
1023
- NAPI_STATUS_THROWS(GetProperty(env, options, "optimizeFiltersForHits", dbOptions.optimize_filters_for_hits));
1024
-
1025
1026
  dbOptions.bytes_per_sync = 1024 * 1024;
1026
1027
  NAPI_STATUS_THROWS(GetProperty(env, options, "bytesPerSync", dbOptions.bytes_per_sync));
1027
1028
 
@@ -1034,7 +1035,7 @@ NAPI_METHOD(db_open) {
1034
1035
  dbOptions.create_if_missing = false;
1035
1036
  NAPI_STATUS_THROWS(GetProperty(env, options, "createIfMissing", dbOptions.create_if_missing));
1036
1037
 
1037
- dbOptions.enable_pipelined_write = false;
1038
+ dbOptions.error_if_exists = false;
1038
1039
  NAPI_STATUS_THROWS(GetProperty(env, options, "errorIfExists", dbOptions.error_if_exists));
1039
1040
 
1040
1041
  dbOptions.enable_pipelined_write = true;
@@ -1043,6 +1044,9 @@ NAPI_METHOD(db_open) {
1043
1044
  dbOptions.daily_offpeak_time_utc = "";
1044
1045
  NAPI_STATUS_THROWS(GetProperty(env, options, "dailyOffpeakTime", dbOptions.daily_offpeak_time_utc));
1045
1046
 
1047
+ dbOptions.unordered_write = false;
1048
+ NAPI_STATUS_THROWS(GetProperty(env, options, "unorderedWrite", dbOptions.unordered_write));
1049
+
1046
1050
  // TODO (feat): dbOptions.listeners
1047
1051
 
1048
1052
  std::string infoLogLevel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/rocksdb",
3
- "version": "13.0.0",
3
+ "version": "13.0.2",
4
4
  "description": "A low-level Node.js RocksDB binding",
5
5
  "license": "MIT",
6
6
  "main": "index.js",