diskdown default to Combined

This commit is contained in:
Jaco Greeff
2018-08-27 14:48:42 +02:00
parent 5a832ad224
commit 44ce7fa901
2 changed files with 4 additions and 8 deletions
+2 -6
View File
@@ -10,7 +10,7 @@ import isUndefined from '@polkadot/util/is/undefined';
import logger from '@polkadot/util/logger';
import Combined from './store/Combined';
import Scatter from './store/Scatter';
// import Scatter from './store/Scatter';
const LRU_SIZE = 8192;
@@ -25,12 +25,8 @@ class DiskDown extends AbstractLevelDOWN {
constructor (location: string) {
super(location);
// FIXME We only want one of these, however add both to aid in easy
// debug testing (i.e. remove the one not needed - defaults still to
// Scatter with the override as set here)
// this._disk = new Scatter(location);
this._disk = new Combined(location);
this._disk = new Scatter(location);
this._store = new LRUMap(LRU_SIZE);
}
+2 -2
View File
@@ -40,7 +40,7 @@ const UINT_SIZE = 6; // 48-bit, the max Node supports
const KEY_SIZE = 32;
const KEY_TOTAL_SIZE = KEY_SIZE + UINT_SIZE + UINT_SIZE;
const ENTRY_SIZE = 1 + UINT_SIZE;
const HEADER_SIZE = 10 * ENTRY_SIZE;
const HEADER_SIZE = 256 * ENTRY_SIZE;
const l = logger('disk/combined');
@@ -296,7 +296,7 @@ export default class StoreCombined implements DiskStore {
};
}
throw new Error(`Unhandled entry type ${entry[0]}`);
throw new Error(`Unhandled entry type ${entryType}`);
}
private findKey (key: Buffer, doCreate: boolean): Leaf | null {