private void Write() { Task[] tasks = null; try { IEnumerable <KeyValuePair <long, Tick> >[] flows = new IEnumerable <KeyValuePair <long, Tick> > [FlowCount]; for (int k = 0; k < flows.Length; k++) { flows[k] = GetFlow(); } ActiveReport = Reports[WRITE]; ActiveReport.Start(); tasks = DoWrite(flows); Task.WaitAll(tasks, Cancellation); DatabaseSize = Database.Size; } finally { ActiveReport.Stop(); tasks = null; ActiveReport = null; } }
private void Init() { try { ActiveReport = Reports[WRITE]; ActiveReport.Start(); Database.Open(); Database.DeleteTable(TableName); Table = Database.OpenOrCreateTable(TableName); } finally { ActiveReport.Stop(); ActiveReport = null; } }
private void SecondaryRead() { Task task = null; try { ActiveReport = Reports[SECONDARY_READ]; ActiveReport.Start(); task = DoRead(); task.Wait(Cancellation); DatabaseSize = Database.Size; } finally { ActiveReport.Stop(); task = null; ActiveReport = null; } }
public void Finish() { if (!Cancellation.IsCancellationRequested) { DatabaseSize = Database.Size; } else { DatabaseSize = 0; return; } ActiveReport = Reports[SECONDARY_READ]; ActiveReport.Start(); try { Database.Close(); } finally { ActiveReport.Stop(); } }