Ejemplo n.º 1
0
        /// <summary>
        /// Overrides the base Execute() semantics to add a listener available for aggregated processing of sub grids in the request engine.
        /// </summary>
        public override TSubGridRequestsResponse Execute()
        {
            CheckArguments();

            // Construct the argument to be supplied to the compute cluster
            PrepareArgument();

            Log.LogInformation($"Prepared argument has TRexNodeId = {arg.TRexNodeID}");
            Log.LogInformation($"Production Data mask in argument to renderer contains {ProdDataMask.CountBits()} sub grids");
            Log.LogInformation($"Surveyed Surface mask in argument to renderer contains {SurveyedSurfaceOnlyMask.CountBits()} sub grids");

            TSubGridRequestsResponse taskResult = null;

            var sw = Stopwatch.StartNew();

            try
            {
                // Construct the function to be used
                var func = new SubGridsRequestComputeFuncAggregative <TSubGridsRequestArgument, TSubGridRequestsResponse>(TRexTask);

                // Invoke it.
                // Note that this is NOT asking the grid to perform a remote invocation of the request as this aggregative
                // processing is already executing on the cluster node containing sub grids.
                taskResult = func.Invoke(arg);
            }
            finally
            {
                Log.LogInformation($"TaskResult {(taskResult == null ? "<NullResult>" : taskResult.ResponseCode.ToString())}: SubGridRequests.Execute() for DM:{TRexTask.PipeLine.DataModelID} from node {TRexTask.TRexNodeID} for data type {TRexTask.GridDataType} took {sw.ElapsedMilliseconds}ms");
            }

            // Advise the pipeline of all the sub grids that were examined in the aggregated processing
            TRexTask.PipeLine.SubGridsProcessed(taskResult?.NumSubgridsExamined ?? 0);

            // Notify the pipeline that all processing has been completed for it
            TRexTask.PipeLine.PipelineCompleted = true;

            // Send the appropriate response to the caller
            return(taskResult);
        }
Ejemplo n.º 2
0
        private void PrepareForExecution()
        {
            CheckArguments();

            // Construct the argument to be supplied to the compute cluster
            PrepareArgument();

            Log.LogInformation($"Prepared argument has TRexNodeId = {arg.TRexNodeID}");
            Log.LogInformation($"Production Data mask in argument to renderer contains {ProdDataMask.CountBits()} sub grids");
            Log.LogInformation($"Surveyed Surface mask in argument to renderer contains {SurveyedSurfaceOnlyMask.CountBits()} sub grids");

            CreateSubGridListener();
        }