Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize RocksDb startup
Browse files Browse the repository at this point in the history
shargon committed Aug 25, 2020
1 parent c465029 commit 496d390
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/RocksDBStore/Plugins/Storage/Store.cs
Original file line number Diff line number Diff line change
@@ -20,8 +20,16 @@ internal class Store : IStore
public Store(string path)
{
var families = new ColumnFamilies();
for (int x = 0; x <= byte.MaxValue; x++)
families.Add(new ColumnFamilies.Descriptor(x.ToString(), new ColumnFamilyOptions()));

try
{
foreach (var family in RocksDb.ListColumnFamilies(Options.Default, Path.GetFullPath(path)))
{
families.Add(new ColumnFamilies.Descriptor(family, new ColumnFamilyOptions()));
}
}
catch { }

db = RocksDb.Open(Options.Default, Path.GetFullPath(path), families);

ColumnFamilyHandle defaultFamily = db.GetDefaultColumnFamily();

0 comments on commit 496d390

Please sign in to comment.