Пример #1
0
 /// <summary>
 ///   Create a new typed Key-Value store
 /// </summary>
 /// <remarks>
 ///   Please note that the internal sort order will still be based upon the byte-array comparer
 /// </remarks>
 /// <param name="keySerializer">Serializer to use to handle keys</param>
 /// <param name="valueSerializer">Serializer to use to handle values</param>
 /// <param name="location">Directory that will store the PlaneDB</param>
 /// <param name="mode">File mode to use, supported are: CreateNew, Open (existing), OpenOrCreate</param>
 /// <param name="options">Options to use, such as the transformer, cache settings, etc.</param>
 public TypedPlaneDB(ISerializer <TKey> keySerializer, ISerializer <TValue> valueSerializer, DirectoryInfo location,
                     FileMode mode, PlaneDBOptions options)
 {
     this.keySerializer   = keySerializer;
     this.valueSerializer = valueSerializer;
     wrapped = new PlaneDB(location, mode, options);
     wrapped.OnFlushMemoryTable += (sender, db) => OnFlushMemoryTable?.Invoke(this, this);
     wrapped.OnMergedTables     += (sender, db) => OnMergedTables?.Invoke(this, this);
 }
Пример #2
0
 /// <param name="location">Directory that will store the PlaneSet</param>
 /// <param name="mode">File mode to use, supported are: CreateNew, Open (existing), OpenOrCreate</param>
 /// <param name="options">Options to use, such as the transformer, cache settings, etc.</param>
 /// <summary>Opens or creates a new PlaneSet</summary>
 public PlaneSet(DirectoryInfo location, FileMode mode, PlaneDBOptions options)
 {
     wrappeDB = new PlaneDB(location, mode, options);
 }