public void resetStore() { // only used in unit tests. // bit dangerous and deletes files! try { db.close(); uncommited = null; uncommitedDeletes = null; autoCommit = true; bloom = new BloomFilter(); utxoCache = new LRUCache(openOutCache, 0.75f); } catch (IOException e) { log.error("Exception in resetStore.", e); } File f = new File(filename); if (f.isDirectory()) { for (File c : f.listFiles()) c.delete(); } openDB(); } }
private void openDB() { Options options = new Options(); options.createIfMissing(true); // options.compressionType(CompressionType.NONE); options.cacheSize(leveldbReadCache); options.writeBufferSize(leveldbWriteCache); options.maxOpenFiles(10000); // options.blockSize(1024*1024*50); try { db = factory.open(new File(filename), options); } catch (IOException e) { throw new RuntimeException("Can not open DB", e); } utxoCache = new LRUCache(openOutCache, 0.75f); try { if (batchGet(getKey(KeyType.CREATED)) == null) { createNewStore(params); } else { initFromDb(); } } catch (BlockStoreException e) { throw new RuntimeException("Can not init/load db", e); } }
private void openDB() { Options options = new Options(); options.createIfMissing(true); // options.compressionType(CompressionType.NONE); options.cacheSize(leveldbReadCache); options.writeBufferSize(leveldbWriteCache); options.maxOpenFiles(10000); // options.blockSize(1024*1024*50); try { db = factory.open(new File(filename), options); } catch (IOException e) { throw new RuntimeException("Can not open DB", e); } utxoCache = new LRUCache(openOutCache, 0.75f); try { if (batchGet(getKey(KeyType.CREATED)) == null) { createNewStore(params); } else { initFromDb(); } } catch (BlockStoreException e) { throw new RuntimeException("Can not init/load db", e); } }
private void openDB() { Options options = new Options(); options.createIfMissing(true); // options.compressionType(CompressionType.NONE); options.cacheSize(leveldbReadCache); options.writeBufferSize(leveldbWriteCache); options.maxOpenFiles(10000); // options.blockSize(1024*1024*50); try { db = factory.open(new File(filename), options); } catch (IOException e) { throw new RuntimeException("Can not open DB", e); } utxoCache = new LRUCache(openOutCache, 0.75f); try { if (batchGet(getKey(KeyType.CREATED)) == null) { createNewStore(params); } else { initFromDb(); } } catch (BlockStoreException e) { throw new RuntimeException("Can not init/load db", e); } }
private void openDB() { Options options = new Options(); options.createIfMissing(true); // options.compressionType(CompressionType.NONE); options.cacheSize(leveldbReadCache); options.writeBufferSize(leveldbWriteCache); options.maxOpenFiles(10000); // options.blockSize(1024*1024*50); try { db = factory.open(new File(filename), options); } catch (IOException e) { throw new RuntimeException("Can not open DB", e); } utxoCache = new LRUCache(openOutCache, 0.75f); try { if (batchGet(getKey(KeyType.CREATED)) == null) { createNewStore(params); } else { initFromDb(); } } catch (BlockStoreException e) { throw new RuntimeException("Can not init/load db", e); } }
public void resetStore() { // only used in unit tests. // bit dangerous and deletes files! try { db.close(); uncommited = null; uncommitedDeletes = null; autoCommit = true; bloom = new BloomFilter(); utxoCache = new LRUCache(openOutCache, 0.75f); } catch (IOException e) { log.error("Exception in resetStore.", e); } File f = new File(filename); if (f.isDirectory()) { for (File c : f.listFiles()) c.delete(); } openDB(); } }
public void resetStore() { // only used in unit tests. // bit dangerous and deletes files! try { db.close(); uncommited = null; uncommitedDeletes = null; autoCommit = true; bloom = new BloomFilter(); utxoCache = new LRUCache(openOutCache, 0.75f); } catch (IOException e) { log.error("Exception in resetStore.", e); } File f = new File(filename); if (f.isDirectory()) { for (File c : f.listFiles()) c.delete(); } openDB(); } }
public void resetStore() { // only used in unit tests. // bit dangerous and deletes files! try { db.close(); uncommited = null; uncommitedDeletes = null; autoCommit = true; bloom = new BloomFilter(); utxoCache = new LRUCache(openOutCache, 0.75f); } catch (IOException e) { log.error("Exception in resetStore.", e); } File f = new File(filename); if (f.isDirectory()) { for (File c : f.listFiles()) c.delete(); } openDB(); } }
@Override protected boolean removeEldestEntry(Map.Entry<ByteBuffer, UTXO> eldest) { return size() > this.capacity; } }
@Override protected boolean removeEldestEntry(Map.Entry<ByteBuffer, UTXO> eldest) { return size() > this.capacity; } }
@Override protected boolean removeEldestEntry(Map.Entry<ByteBuffer, UTXO> eldest) { return size() > this.capacity; } }
@Override protected boolean removeEldestEntry(Map.Entry<ByteBuffer, UTXO> eldest) { return size() > this.capacity; } }