@nxtedition/rocksdb 13.0.0 → 13.0.1

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.
Files changed (2) hide show
  1. package/binding.cc +22 -16
  2. package/package.json +1 -1
package/binding.cc CHANGED
@@ -885,6 +885,10 @@ 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_THROWS(GetProperty(env, options, "optimizeFiltersForHits", columnOptions.optimize_filters_for_hits));
890
+
891
+
888
892
  uint32_t cacheSize = 8 << 20;
889
893
  NAPI_STATUS_RETURN(GetProperty(env, options, "cacheSize", cacheSize));
890
894
 
@@ -892,11 +896,8 @@ napi_status InitOptions(napi_env env, T& columnOptions, const U& options) {
892
896
 
893
897
  if (cacheSize) {
894
898
  tableOptions.block_cache = rocksdb::HyperClockCacheOptions(cacheSize, 0).MakeSharedCache();
895
- NAPI_STATUS_RETURN(
896
- GetProperty(env, options, "cacheIndexAndFilterBlocks", tableOptions.cache_index_and_filter_blocks));
897
899
  } else {
898
900
  tableOptions.no_block_cache = true;
899
- tableOptions.cache_index_and_filter_blocks = false;
900
901
  }
901
902
 
902
903
  std::string optimize = "";
@@ -915,9 +916,6 @@ napi_status InitOptions(napi_env env, T& columnOptions, const U& options) {
915
916
  tableOptions.filter_policy.reset(rocksdb::NewBloomFilterPolicy(10));
916
917
  }
917
918
 
918
- tableOptions.enable_index_compression = false;
919
- NAPI_STATUS_RETURN(GetProperty(env, options, "enableIndexCompression", tableOptions.enable_index_compression));
920
-
921
919
  std::optional<std::string> filterPolicyOpt;
922
920
  NAPI_STATUS_RETURN(GetProperty(env, options, "filterPolicy", filterPolicyOpt));
923
921
  if (filterPolicyOpt) {
@@ -925,11 +923,20 @@ napi_status InitOptions(napi_env env, T& columnOptions, const U& options) {
925
923
  rocksdb::FilterPolicy::CreateFromString(configOptions, *filterPolicyOpt, &tableOptions.filter_policy));
926
924
  }
927
925
 
926
+ tableOptions.block_size = 4 * 1024;
928
927
  NAPI_STATUS_RETURN(GetProperty(env, options, "blockSize", tableOptions.block_size));
929
928
 
929
+ tableOptions.block_restart_interval = 16;
930
930
  NAPI_STATUS_RETURN(GetProperty(env, options, "blockRestartInterval", tableOptions.block_restart_interval));
931
931
 
932
- tableOptions.checksum = rocksdb::kXXH3;
932
+ tableOptions.block_align = false;
933
+ NAPI_STATUS_RETURN(GetProperty(env, options, "blockAlign", tableOptions.block_align));
934
+
935
+ tableOptions.cache_index_and_filter_blocks = true; // false
936
+ NAPI_STATUS_RETURN(GetProperty(env, options, "cacheIndexAndFilterBlocks", tableOptions.cache_index_and_filter_blocks));
937
+
938
+ tableOptions.cache_index_and_filter_blocks_with_high_priority = true;
939
+ NAPI_STATUS_RETURN(GetProperty(env, options, "cacheIndexAndFilterBlocksWithHighPriority", tableOptions.cache_index_and_filter_blocks_with_high_priority));
933
940
 
934
941
  tableOptions.decouple_partitioned_filters = true;
935
942
  NAPI_STATUS_RETURN(GetProperty(env, options, "decouplePartitionedFilters", tableOptions.block_restart_interval));
@@ -937,12 +944,13 @@ napi_status InitOptions(napi_env env, T& columnOptions, const U& options) {
937
944
  tableOptions.optimize_filters_for_memory = true;
938
945
  NAPI_STATUS_RETURN(GetProperty(env, options, "optimizeFiltersForMemory", tableOptions.optimize_filters_for_memory));
939
946
 
940
- tableOptions.enable_index_compression = false;
941
- NAPI_STATUS_RETURN(GetProperty(env, options, "enableIndexCompression", tableOptions.enable_index_compression));
942
947
 
943
948
  tableOptions.max_auto_readahead_size = 256 * 1024;
944
949
  NAPI_STATUS_RETURN(GetProperty(env, options, "maxAutoReadaheadSize", tableOptions.max_auto_readahead_size));
945
950
 
951
+ tableOptions.num_file_reads_for_auto_readahead = 2;
952
+ NAPI_STATUS_RETURN(GetProperty(env, options, "numFileReadsForAutoReadahead", tableOptions.num_file_reads_for_auto_readahead));
953
+
946
954
  columnOptions.table_factory.reset(rocksdb::NewBlockBasedTableFactory(tableOptions));
947
955
 
948
956
  return napi_ok;
@@ -995,9 +1003,7 @@ NAPI_METHOD(db_open) {
995
1003
  NAPI_STATUS_THROWS(GetProperty(env, options, "walSizeLimit", walSizeLimit));
996
1004
  dbOptions.WAL_size_limit_MB = walSizeLimit / 1e6;
997
1005
 
998
- uint32_t maxTotalWalSize = 0;
999
- NAPI_STATUS_THROWS(GetProperty(env, options, "walTotalSizeLimit", walSizeLimit));
1000
- dbOptions.max_total_wal_size = maxTotalWalSize / 1e6;
1006
+ NAPI_STATUS_THROWS(GetProperty(env, options, "maxTotalWalSize", dbOptions.max_total_wal_size));
1001
1007
 
1002
1008
  bool walCompression = true;
1003
1009
  NAPI_STATUS_THROWS(GetProperty(env, options, "walCompression", walCompression));
@@ -1019,9 +1025,6 @@ NAPI_METHOD(db_open) {
1019
1025
  dbOptions.advise_random_on_open = true;
1020
1026
  NAPI_STATUS_THROWS(GetProperty(env, options, "adviseRandomOnOpen", dbOptions.advise_random_on_open));
1021
1027
 
1022
- dbOptions.optimize_filters_for_hits = false;
1023
- NAPI_STATUS_THROWS(GetProperty(env, options, "optimizeFiltersForHits", dbOptions.optimize_filters_for_hits));
1024
-
1025
1028
  dbOptions.bytes_per_sync = 1024 * 1024;
1026
1029
  NAPI_STATUS_THROWS(GetProperty(env, options, "bytesPerSync", dbOptions.bytes_per_sync));
1027
1030
 
@@ -1034,7 +1037,7 @@ NAPI_METHOD(db_open) {
1034
1037
  dbOptions.create_if_missing = false;
1035
1038
  NAPI_STATUS_THROWS(GetProperty(env, options, "createIfMissing", dbOptions.create_if_missing));
1036
1039
 
1037
- dbOptions.enable_pipelined_write = false;
1040
+ dbOptions.error_if_exists = false;
1038
1041
  NAPI_STATUS_THROWS(GetProperty(env, options, "errorIfExists", dbOptions.error_if_exists));
1039
1042
 
1040
1043
  dbOptions.enable_pipelined_write = true;
@@ -1043,6 +1046,9 @@ NAPI_METHOD(db_open) {
1043
1046
  dbOptions.daily_offpeak_time_utc = "";
1044
1047
  NAPI_STATUS_THROWS(GetProperty(env, options, "dailyOffpeakTime", dbOptions.daily_offpeak_time_utc));
1045
1048
 
1049
+ dbOptions.unordered_write = false;
1050
+ NAPI_STATUS_THROWS(GetProperty(env, options, "unorderedWrite", dbOptions.unordered_write));
1051
+
1046
1052
  // TODO (feat): dbOptions.listeners
1047
1053
 
1048
1054
  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.1",
4
4
  "description": "A low-level Node.js RocksDB binding",
5
5
  "license": "MIT",
6
6
  "main": "index.js",