Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        private void Init()
        {
            try
            {
                ActiveReport = Reports[WRITE];
                ActiveReport.Start();

                Database.Open();

                Database.DeleteTable(TableName);
                Table = Database.OpenOrCreateTable(TableName);
            }
            finally
            {
                ActiveReport.Stop();
                ActiveReport = null;
            }
        }
Exemplo n.º 3
0
        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;
            }
        }
Exemplo n.º 4
0
        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();
            }
        }