public void Repair() { LevelDBInterop.leveldb_close(Database); Database = IntPtr.Zero; var options = LevelDBInterop.leveldb_options_create(); IntPtr error; LevelDBInterop.leveldb_repair_db(options, DatabasePath, out error); LevelDBException.Check(error); LevelDBInterop.leveldb_options_destroy(options); }
public void Cache() { LevelDBInterop.leveldb_close(Database); Database = IntPtr.Zero; // open the DB with a cache that is not owned by LevelDB, then // close DB and then free the cache var options = LevelDBInterop.leveldb_options_create(); var cache = LevelDBInterop.leveldb_cache_create_lru((IntPtr)64); LevelDBInterop.leveldb_options_set_cache(options, cache); IntPtr error; Database = LevelDBInterop.leveldb_open(options, DatabasePath, out error); LevelDBException.Check(error); LevelDBInterop.leveldb_close(Database); Database = IntPtr.Zero; LevelDBInterop.leveldb_cache_destroy(cache); LevelDBInterop.leveldb_options_destroy(options); }
internal override void DestroyUnmanaged() { this.TryDestroyCacheHandle(); LevelDBInterop.leveldb_options_destroy(this._handle); }