本文整理汇总了C#中HashListMemTable类的典型用法代码示例。如果您正苦于以下问题:C# HashListMemTable类的具体用法?C# HashListMemTable怎么用?C# HashListMemTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HashListMemTable类属于命名空间,在下文中一共展示了HashListMemTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestFixtureSetUp
public override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_mergeFile = GetTempFilePath();
_filename = GetTempFilePath();
_map = IndexMap.FromFile(_filename, maxTablesPerLevel: 4);
var memtable = new HashListMemTable(maxSize: 10);
memtable.Add(0, 1, 0);
_result = _map.AddPTable(PTable.FromMemtable(memtable, GetTempFilePath()), 1, 2,
_ => true, new GuidFilenameProvider(PathName));
_result.ToDelete.ForEach(x => x.MarkForDestruction());
_result = _result.MergedMap.AddPTable(PTable.FromMemtable(memtable, GetTempFilePath()), 3, 4,
_ => true, new GuidFilenameProvider(PathName));
_result.ToDelete.ForEach(x => x.MarkForDestruction());
_result = _result.MergedMap.AddPTable(PTable.FromMemtable(memtable, GetTempFilePath()), 4, 5,
_ => true, new GuidFilenameProvider(PathName));
_result.ToDelete.ForEach(x => x.MarkForDestruction());
_result = _result.MergedMap.AddPTable(PTable.FromMemtable(memtable, GetTempFilePath()), 0, 1,
_ => true, new FakeFilenameProvider(_mergeFile));
_result.ToDelete.ForEach(x => x.MarkForDestruction());
}
开发者ID:danieldeb,项目名称:EventStore,代码行数:27,代码来源:adding_four_items_to_empty_index_map_with_four_tables_per_level_causes_merge.cs
示例2: TestFixtureSetUp
public override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_mergeFile = GetTempFilePath();
_filename = GetTempFilePath();
_map = IndexMap.FromFile(_filename, maxTablesPerLevel: 4);
var memtable = new HashListMemTable(_ptableVersion, maxSize: 10);
memtable.Add(0, 1, 0);
_result = _map.AddPTable(PTable.FromMemtable(memtable, GetTempFilePath()), 1, 2,
(streamId, hash) => hash,
_ => true, _ => new System.Tuple<string, bool>("", true), new GuidFilenameProvider(PathName), _ptableVersion);
_result.ToDelete.ForEach(x => x.MarkForDestruction());
_result = _result.MergedMap.AddPTable(PTable.FromMemtable(memtable, GetTempFilePath()), 3, 4,
(streamId, hash) => hash,
_ => true, _ => new System.Tuple<string, bool>("", true), new GuidFilenameProvider(PathName), _ptableVersion);
_result.ToDelete.ForEach(x => x.MarkForDestruction());
_result = _result.MergedMap.AddPTable(PTable.FromMemtable(memtable, GetTempFilePath()), 4, 5,
(streamId, hash) => hash,
_ => true, _ => new System.Tuple<string, bool>("", true), new GuidFilenameProvider(PathName), _ptableVersion);
_result.ToDelete.ForEach(x => x.MarkForDestruction());
_result = _result.MergedMap.AddPTable(PTable.FromMemtable(memtable, GetTempFilePath()), 0, 1,
(streamId, hash) => hash,
_ => true, _ => new System.Tuple<string, bool>("", true), new FakeFilenameProvider(_mergeFile), _ptableVersion);
_result.ToDelete.ForEach(x => x.MarkForDestruction());
}
开发者ID:EventStore,项目名称:EventStore,代码行数:31,代码来源:adding_four_items_to_empty_index_map_with_four_tables_per_level_causes_merge.cs
示例3: SetUp
public override void SetUp()
{
base.SetUp();
_filename = GetFilePathFor("indexfile");
_tablename = GetTempFilePath();
_mergeFile = GetFilePathFor("outfile");
_map = IndexMap.FromFile(_filename, maxTablesPerLevel: 4);
var memtable = new HashListMemTable(maxSize: 10);
memtable.Add(0, 2, 123);
var table = PTable.FromMemtable(memtable, _tablename);
_result = _map.AddPTable(table, 0, 0, _ => true, new FakeFilenameProvider(_mergeFile));
_result = _result.MergedMap.AddPTable(table, 0, 0, _ => true, new FakeFilenameProvider(_mergeFile));
_result = _result.MergedMap.AddPTable(table, 0, 0, _ => true, new FakeFilenameProvider(_mergeFile));
var merged = _result.MergedMap.AddPTable(table, 0, 0, _ => true, new FakeFilenameProvider(_mergeFile));
_result = merged.MergedMap.AddPTable(table, 0, 0, _ => true, new FakeFilenameProvider(_mergeFile));
_result = _result.MergedMap.AddPTable(table, 7, 11, _ => true, new FakeFilenameProvider(_mergeFile));
_result.MergedMap.SaveToFile(_filename);
table.Dispose();
merged.MergedMap.InOrder().ToList().ForEach(x => x.Dispose());
merged.ToDelete.ForEach(x => x.Dispose());
_result.MergedMap.InOrder().ToList().ForEach(x => x.Dispose());
_result.ToDelete.ForEach(x => x.Dispose());
}
示例4: TestFixtureSetUp
public override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
var table = new HashListMemTable(maxSize: 2000);
table.Add(0x0101, 0x0001, 0x0001);
_ptable = PTable.FromMemtable(table, Filename, cacheDepth: 0);
}
示例5: wait_for_destroy_will_timeout
public void wait_for_destroy_will_timeout()
{
var tmp = Path.GetRandomFileName();
var table = new HashListMemTable();
table.Add(0x0101, 0x0001, 0x0001);
var stable = PTable.FromMemtable(table, tmp);
Assert.Throws<TimeoutException>(() => stable.WaitForDestroy(1));
}
示例6: Setup
public void Setup()
{
var mtable = new HashListMemTable(maxSize: 10);
mtable.Add(0x0101, 0x0001, 0x0001);
mtable.Add(0x0105, 0x0001, 0x0002);
_table = PTable.FromMemtable(mtable, Filename);
_table.MarkForDestruction();
}
示例7: Setup
public void Setup()
{
_filename = Path.GetRandomFileName();
var mtable = new HashListMemTable();
mtable.Add(0x0101, 0x0001, 0x0001);
mtable.Add(0x0105, 0x0001, 0x0002);
_table = PTable.FromMemtable(mtable, _filename);
_table.MarkForDestruction();
}
示例8: Setup
public void Setup()
{
_filename = Path.GetRandomFileName();
var table = new HashListMemTable();
AddItemsForScenario(table);
PTable = PTable.FromMemtable(table, _filename, cacheDepth: _midpointCacheDepth);
}
示例9: the_hash_of_file_is_valid
public void the_hash_of_file_is_valid()
{
var table = new HashListMemTable(_ptableVersion, maxSize: 10);
table.Add(0x010100000000, 0x0001, 0x0001);
table.Add(0x010500000000, 0x0001, 0x0002);
table.Add(0x010200000000, 0x0001, 0x0003);
table.Add(0x010200000000, 0x0002, 0x0003);
Assert.DoesNotThrow(() => {using (var sstable = PTable.FromMemtable(table, Filename)) {}});
}
示例10: SetUp
public override void SetUp()
{
base.SetUp();
var table = new HashListMemTable(maxSize: 50);
AddItemsForScenario(table);
PTable = PTable.FromMemtable(table, Filename, cacheDepth: _midpointCacheDepth);
}
示例11: nothing_is_found_on_empty_stream
public void nothing_is_found_on_empty_stream()
{
var memTable = new HashListMemTable(_ptableVersion, maxSize: 10);
memTable.Add(0x010100000000, 0x01, 0xffff);
using (var ptable = PTable.FromMemtable(memTable, Filename))
{
IndexEntry entry;
Assert.IsFalse(ptable.TryGetLatestEntry(0x12, out entry));
}
}
示例12: ConstructPTable
private PTable ConstructPTable(string file, int count, Random rnd)
{
var memTable = new HashListMemTable(_ptableVersion, 20000);
for (int i = 0; i < count; ++i)
{
memTable.Add((uint)rnd.Next(), rnd.Next(0, 1<<20), Math.Abs(rnd.Next() * rnd.Next()));
}
var ptable = PTable.FromMemtable(memTable, file, 0);
return ptable;
}
示例13: wait_for_destroy_will_timeout
public void wait_for_destroy_will_timeout()
{
var table = new HashListMemTable(maxSize: 10);
table.Add(0x0101, 0x0001, 0x0001);
var ptable = PTable.FromMemtable(table, Filename);
Assert.Throws<TimeoutException>(() => ptable.WaitForDestroy(1));
// tear down
ptable.MarkForDestruction();
ptable.WaitForDestroy(1000);
}
示例14: the_hash_of_file_is_valid
public void the_hash_of_file_is_valid()
{
var table = new HashListMemTable(maxSize: 10);
table.Add(0x0101, 0x0001, 0x0001);
table.Add(0x0105, 0x0001, 0x0002);
table.Add(0x0102, 0x0001, 0x0003);
table.Add(0x0102, 0x0002, 0x0003);
using (var sstable = PTable.FromMemtable(table, Filename))
{
Assert.DoesNotThrow(() => sstable.VerifyFileHash());
}
}
示例15: SetUp
public override void SetUp()
{
base.SetUp();
_indexMapFileName = GetFilePathFor("index.map");
_ptableFileName = GetFilePathFor("ptable");
_emptyIndexMap = IndexMap.FromFile(_indexMapFileName, _ptableVersion);
var memTable = new HashListMemTable(_ptableVersion, maxSize: 10);
memTable.Add(0, 1, 2);
_ptable = PTable.FromMemtable(memTable, _ptableFileName, _ptableVersion);
}