예제 #1
0
        public RocksDbContext(RocksDbConfig config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            // Initialize RocksDB (Connection String is the path to use)
            var options = new DbOptions().SetCreateIfMissing();

            // TODO #358: please avoid sync IO in constructor -> Open connection with the first operation for now
            _rocksDb = RocksDb.Open(options, config.FilePath);
        }
예제 #2
0
 public static void Bind(this IConfiguration config, RocksDbConfig rocksDbConfig)
 {
     rocksDbConfig.FilePath = ParseString(config.GetSection("rocksDbProvider"), "filePath");
 }