hypercore-storage 1.6.1 → 1.7.0

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/index.js CHANGED
@@ -310,7 +310,7 @@ class CorestoreStorage {
310
310
  constructor (db, opts) {
311
311
  this.path = typeof db === 'string' ? db : db.path
312
312
  this.rocks = typeof db === 'string' ? new RocksDB(db, opts) : db
313
- this.db = createColumnFamily(this.rocks)
313
+ this.db = createColumnFamily(this.rocks, opts)
314
314
  this.view = null
315
315
  this.enters = 0
316
316
  this.lock = new ScopeLock()
@@ -750,15 +750,23 @@ function isCorestoreStorage (s) {
750
750
  return typeof s === 'object' && !!s && typeof s.setDefaultDiscoveryKey === 'function'
751
751
  }
752
752
 
753
- function createColumnFamily (db) {
753
+ function createColumnFamily (db, opts = {}) {
754
+ const {
755
+ tableCacheIndexAndFilterBlocks = true,
756
+ blockCache = true,
757
+ optimizeFiltersForMemory = false
758
+ } = opts
759
+
754
760
  const col = new RocksDB.ColumnFamily(COLUMN_FAMILY, {
755
761
  enableBlobFiles: true,
756
762
  minBlobSize: 4096,
757
763
  blobFileSize: 256 * 1024 * 1024,
758
764
  enableBlobGarbageCollection: true,
759
765
  tableBlockSize: 8192,
760
- tableCacheIndexAndFilterBlocks: true,
761
- tableFormatVersion: 6
766
+ tableCacheIndexAndFilterBlocks,
767
+ tableFormatVersion: 6,
768
+ optimizeFiltersForMemory,
769
+ blockCache
762
770
  })
763
771
 
764
772
  return db.columnFamily(col)
@@ -238,8 +238,6 @@ class BlockSlicer {
238
238
  let buffer = null
239
239
  if (offset < this.offset) throw new Error('overread')
240
240
 
241
- const end = offset + size
242
-
243
241
  while (true) {
244
242
  let data = null
245
243
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore-storage",
3
- "version": "1.6.1",
3
+ "version": "1.7.0",
4
4
  "main": "index.js",
5
5
  "files": [
6
6
  "index.js",