Exemplo n.º 1
0
 public DynamicStore(string filePathPathWithoutExtension, long capacity, Func <TKey, long> hashFunction,
                     ItemSerializer <TKey, TValue> itemSerializer, HashTableOptions <TKey, TValue> options = null)
     : base(filePathPathWithoutExtension, capacity, new BaseHashTableOptions <TKey, TValue>
 {
     HashFunction  = hashFunction,
     KeyComparer   = options?.KeyComparer,
     ValueComparer = options?.ValueComparer
 })
 {
     initialDataFileSize         = options?.InitialDataFileSize ?? 8 * 1024 * 1024;
     dataFileSizeGrowthIncrement = options?.DataFileSizeGrowthIncrement ?? 4 * 1024 * 1024;
     this.itemSerializer         = itemSerializer;
 }
 public StaticFixedKeySizeStore(string filePathPathWithoutExtension, long capacity, Func <TKey, long> hashFunction, IValueSerializer <TValue> valueSerializer,
                                HashTableOptions <TKey, TValue> options)
     : base(filePathPathWithoutExtension, capacity,
            new BaseHashTableOptions <TKey, TValue>
 {
     HashFunction  = hashFunction,
     KeyComparer   = options?.KeyComparer ?? EqualityComparer <TKey> .Default,
     ValueComparer = options?.ValueComparer
 })
 {
     initialDataFileSize         = options?.InitialDataFileSize ?? 8 * 1024 * 1024;
     dataFileSizeGrowthIncrement = options?.DataFileSizeGrowthIncrement ?? 4 * 1024 * 1024;
     this.valueSerializer        = valueSerializer;
 }
Exemplo n.º 3
0
 public static StaticStore <TKey, TValue> GetStaticStore <TKey, TValue>(string filePathWithoutExtension, long capacity, Func <TKey, long> hashFunction, ItemSerializer <TKey, TValue> itemSerializer, HashTableOptions <TKey, TValue> options = null)
 {
     return(new StaticStore <TKey, TValue>(filePathWithoutExtension, capacity, hashFunction, itemSerializer, options));
 }
Exemplo n.º 4
0
 public static StaticStore GetStaticStore(string filePathWithoutExtension, long capacity, Func <MemorySlice, long> hashFunction = null, HashTableOptions <MemorySlice, MemorySlice> options = null)
 {
     return(new StaticStore(filePathWithoutExtension, capacity, hashFunction, options));
 }
Exemplo n.º 5
0
 public static StaticFixedKeySizeStore <TKey, TValue> GetStaticFixedKeySizeStore <TKey, TValue>(string filePathWithoutExtension, long capacity, Func <TKey, long> hashFunction, IValueSerializer <TValue> valueSerializer, HashTableOptions <TKey, TValue> options = null)
     where TKey : unmanaged
 {
     return(new StaticFixedKeySizeStore <TKey, TValue>(filePathWithoutExtension, capacity, hashFunction, valueSerializer, options));
 }
Exemplo n.º 6
0
 public static StaticFixedKeySizeStore <TKey> GetStaticFixedKeySizeStore <TKey>(string filePathWithoutExtension, long capacity, Func <TKey, long> hashFunction, HashTableOptions <TKey, MemorySlice> options = null)
     where TKey : unmanaged
 {
     return(new StaticFixedKeySizeStore <TKey>(filePathWithoutExtension, capacity, hashFunction, options));
 }