Exemple #1
0
        private bool FetchData()
        {
            EventHandler eventHandler = null;
            int          count        = this.m_runtimeDataSources.Count;
            ThreadSet    threadSet    = null;

            try
            {
                if (this.m_odpContext.AbortInfo != null)
                {
                    eventHandler = this.AbortHandler;
                    this.m_odpContext.AbortInfo.ProcessingAbortEvent += eventHandler;
                }
                if (count != 0)
                {
                    RuntimeAtomicDataSource @object;
                    if (count > 1)
                    {
                        threadSet = new ThreadSet(count - 1);
                        try
                        {
                            for (int i = 1; i < count; i++)
                            {
                                @object = this.m_runtimeDataSources[i];
                                threadSet.TryQueueWorkItem(this.m_odpContext, @object.ProcessConcurrent);
                            }
                        }
                        catch (Exception e)
                        {
                            if (this.m_odpContext.AbortInfo != null)
                            {
                                this.m_odpContext.AbortInfo.SetError(e, this.m_odpContext.ProcessingAbortItemUniqueIdentifier);
                            }
                            throw;
                        }
                    }
                    @object = this.m_runtimeDataSources[0];
                    @object.ProcessConcurrent(null);
                }
            }
            finally
            {
                if (threadSet != null && count > 1)
                {
                    threadSet.WaitForCompletion();
                    threadSet.Dispose();
                }
                if (eventHandler != null)
                {
                    this.m_odpContext.AbortInfo.ProcessingAbortEvent -= eventHandler;
                }
            }
            this.m_odpContext.CheckAndThrowIfAborted();
            return(true);
        }
 public void ProcessConcurrent(object threadSet)
 {
     Global.Tracer.Assert(base.m_dataSet.Name != null, "The name of a data set cannot be null.");
     try
     {
         if (Global.Tracer.TraceVerbose)
         {
             Global.Tracer.Trace(TraceLevel.Verbose, "Thread has started processing data set '{0}'", base.m_dataSet.Name.MarkAsPrivate());
         }
         this.Process(null);
     }
     catch (ProcessingAbortedException)
     {
         if (Global.Tracer.TraceWarning)
         {
             Global.Tracer.Trace(TraceLevel.Warning, "Data set '{0}': Report processing has been aborted.", base.m_dataSet.Name.MarkAsPrivate());
         }
         if (!base.m_odpContext.StreamingMode)
         {
             goto end_IL_0063;
         }
         throw;
         end_IL_0063 :;
     }
     catch (Exception ex2)
     {
         if (Global.Tracer.TraceError)
         {
             Global.Tracer.Trace(TraceLevel.Error, "An exception has occurred in data set '{0}'. Details: {1}", base.m_dataSet.Name.MarkAsPrivate(), ex2.ToString());
         }
         if (base.m_odpContext.AbortInfo != null)
         {
             base.m_odpContext.AbortInfo.SetError(ex2, base.m_odpContext.ProcessingAbortItemUniqueIdentifier);
             goto end_IL_00ac;
         }
         throw;
         end_IL_00ac :;
     }
     finally
     {
         if (Global.Tracer.TraceVerbose)
         {
             Global.Tracer.Trace(TraceLevel.Verbose, "Processing of data set '{0}' completed.", base.m_dataSet.Name.MarkAsPrivate());
         }
         ThreadSet threadSet2 = threadSet as ThreadSet;
         if (threadSet2 != null)
         {
             threadSet2.ThreadCompleted();
         }
     }
 }
Exemple #3
0
 public void ProcessConcurrent(object threadSet)
 {
     try
     {
         if (Global.Tracer.TraceVerbose)
         {
             Global.Tracer.Trace(TraceLevel.Verbose, "Thread has started processing data source '{0}'", base.DataSourceDefinition.Name.MarkAsModelInfo());
         }
         this.Process(false);
     }
     catch (ProcessingAbortedException)
     {
         if (Global.Tracer.TraceWarning)
         {
             Global.Tracer.Trace(TraceLevel.Warning, "Data source '{0}': Report processing has been aborted.", base.DataSourceDefinition.Name.MarkAsModelInfo());
         }
         if (!base.m_odpContext.StreamingMode)
         {
             goto end_IL_0043;
         }
         throw;
         end_IL_0043 :;
     }
     catch (Exception ex2)
     {
         if (Global.Tracer.TraceError)
         {
             Global.Tracer.Trace(TraceLevel.Error, "An exception has occurred in data source '{0}'. Details: {1}", base.DataSourceDefinition.Name.MarkAsModelInfo(), ex2.ToString());
         }
         if (base.OdpContext.AbortInfo != null)
         {
             base.OdpContext.AbortInfo.SetError(ex2, base.OdpContext.ProcessingAbortItemUniqueIdentifier);
             goto end_IL_008c;
         }
         throw;
         end_IL_008c :;
     }
     finally
     {
         if (Global.Tracer.TraceVerbose)
         {
             Global.Tracer.Trace(TraceLevel.Verbose, "Processing of data source '{0}' completed.", base.DataSourceDefinition.Name.MarkAsModelInfo());
         }
         ThreadSet threadSet2 = threadSet as ThreadSet;
         if (threadSet2 != null)
         {
             threadSet2.ThreadCompleted();
         }
     }
 }
Exemple #4
0
        private void ExecuteParallelDataSets()
        {
            ThreadSet threadSet = new ThreadSet(base.m_runtimeDataSets.Count - 1);

            try
            {
                for (int i = 1; i < base.m_runtimeDataSets.Count; i++)
                {
                    RuntimeAtomicDataSet runtimeAtomicDataSet = (RuntimeAtomicDataSet)base.m_runtimeDataSets[i];
                    runtimeAtomicDataSet.InitProcessingParams(null, base.m_transaction);
                    threadSet.TryQueueWorkItem(base.m_odpContext, runtimeAtomicDataSet.ProcessConcurrent);
                }
                RuntimeAtomicDataSet runtimeAtomicDataSet2 = (RuntimeAtomicDataSet)base.m_runtimeDataSets[0];
                runtimeAtomicDataSet2.InitProcessingParams(base.m_connection, base.m_transaction);
                runtimeAtomicDataSet2.ProcessConcurrent(null);
            }
            catch (Exception e)
            {
                if (base.m_odpContext.AbortInfo != null)
                {
                    base.m_odpContext.AbortInfo.SetError(e, base.m_odpContext.ProcessingAbortItemUniqueIdentifier);
                }
                throw;
            }
            finally
            {
                threadSet.WaitForCompletion();
                threadSet.Dispose();
            }
            if (this.NeedsExecutionLogging && base.m_odpContext.JobContext != null)
            {
                DataProcessingMetrics dataProcessingMetrics = null;
                for (int j = 0; j < base.m_runtimeDataSets.Count; j++)
                {
                    RuntimeDataSet runtimeDataSet = base.m_runtimeDataSets[j];
                    if (dataProcessingMetrics == null || runtimeDataSet.DataSetExecutionMetrics.TotalDurationMs > dataProcessingMetrics.TotalDurationMs)
                    {
                        dataProcessingMetrics = runtimeDataSet.DataSetExecutionMetrics;
                    }
                }
                base.m_executionMetrics.Add(dataProcessingMetrics);
            }
        }