Example #1
0
        public PipelineSection(string machineName, uint orderNumber, PipelineType pipelineType, string pipelineId, RolePlan rolePlan)
        {
            OrderNumber        = orderNumber;
            RoleType           = rolePlan.RoleType;
            Name               = rolePlan.Name;
            OutputSectionNames = rolePlan.OutputSectionNames ?? new List <string>();

            HiringPipeName = new HiringPipeName(machineName, pipelineId, Name);
            using (var hiringPipe = new Pipe(HiringPipeName))
            {
                hiringPipe.Create();

                for (uint slotNumber = 0; slotNumber < rolePlan.Slots; slotNumber++)
                {
                    RoleSlotToken roleSlot = new RoleSlotToken(slotNumber);
                    var           envelope = new PipeMessageEnvelope()
                    {
                        Body  = roleSlot,
                        Label = "RoleSlot " + slotNumber,
                    };

                    hiringPipe.Send(envelope);
                }
            }

            if (orderNumber > 0) // HACK - first role is not supposed to have data pipe
            {
                DataPipeName = new DataPipeName(machineName, pipelineType, pipelineId, Name);
                using (var dataPipe = new Pipe(DataPipeName))
                {
                    dataPipe.Create();
                }
            }
        }
 public void SendProblemReport(Pipe ReportPipe)
 {
     TimeStamp = DateTime.Now;
     var envelope = new PipeMessageEnvelope()
                         {
                             Body = this,
                             Label = MessageLabel,
                         };
     ReportPipe.Send(envelope);
 }
Example #3
0
        public void SendProblemReport(Pipe ReportPipe)
        {
            TimeStamp = DateTime.Now;
            var envelope = new PipeMessageEnvelope()
            {
                Body  = this,
                Label = MessageLabel,
            };

            ReportPipe.Send(envelope);
        }
        /// <summary>
        /// Reports the errors.
        /// </summary>
        /// <param name="logPipe"></param>
        /// <param name="errorDocumentDetails">The error document details.</param>
        /// <param name="pipelineId">The pipeline identifier.</param>
        /// <param name="workerId">The worker identifier.</param>
        /// <param name="workerRoleTypeId"></param>
        /// <returns></returns>
        internal static IEnumerable<JobWorkerLog<ProductionParserLogInfo>> SendProductionLogs(Pipe logPipe, IEnumerable<ProductionDocumentDetail> errorDocumentDetails, string pipelineId, string workerId, string workerRoleTypeId)
        {
            if(errorDocumentDetails==null) return null;
             var productionParserLogInfos = new List<JobWorkerLog<ProductionParserLogInfo>>();
            try
            {
               
                var jobRunId = Convert.ToInt64(pipelineId);
                foreach (var errorDocument in errorDocumentDetails)
                {


                    var parserLog = new JobWorkerLog<ProductionParserLogInfo>
                    {
                        JobRunId =jobRunId,
                        CorrelationId = errorDocument.CorrelationId,
                        WorkerRoleType = workerRoleTypeId,
                        WorkerInstanceId = workerId,
                        IsMessage = false,
                        Success = false,
                        CreatedBy = errorDocument.CreatedBy,
                        LogInfo =
                            new ProductionParserLogInfo
                            {
                                Information = errorDocument.ErrorMessage,
                                BatesNumber = errorDocument.AllBates,
                                DatasetName = errorDocument.OriginalDatasetName,
                                DCN = errorDocument.DCNNumber,
                                ProductionDocumentNumber = errorDocument.DocumentProductionNumber,
                                ProductionName = errorDocument.Profile.ProfileName
                            }
                    };
                  productionParserLogInfos.Add(parserLog);
                  if (logPipe == null) 
                      Trace.TraceError("log pipe is empty");
                  logPipe.Open();
                  var message = new PipeMessageEnvelope()
                  {
                      Body = productionParserLogInfos
                  };
                  logPipe.Send(message);
                }
              
            }
            catch (Exception exception)
            {
                var dcns = String.Join(",", errorDocumentDetails.Select(errorDoc => errorDoc.DCNNumber));
                exception.AddDbgMsg("Failed to send documents to Redact-It and failed in reporting errors");
                exception.AddDbgMsg(string.Format("Document Control Numbers:{0}", dcns));
                exception.Trace().Swallow();
            }
            return productionParserLogInfos;
        }
 /// <summary>
 /// Send message
 /// </summary>
 private void SendMessage()
 {
     // We get here if Completed() is called for the first time. 
     // Need to send special message to DeleteProjectCleanup worker.
     var pipelineSection = FindPipelineSection("IncludeSubSystemsFinal");
     var dataPipeName = pipelineSection.DataPipeName;
     using (var dataPipe = new Pipe(dataPipeName))
     {
         dataPipe.Open();
         var envelope = new PipeMessageEnvelope() { Label = "PleaseBuildProject" };
         dataPipe.Send(envelope);
     }
     _finalizationRequested = true;
 }
        /// <summary>
        /// Send message
        /// </summary>
        private void SendMessage()
        {
            // We get here if Completed() is called for the first time.
            // Need to send special message to DeleteProjectCleanup worker.
            var pipelineSection = FindPipelineSection("IncludeSubSystemsFinal");
            var dataPipeName    = pipelineSection.DataPipeName;

            using (var dataPipe = new Pipe(dataPipeName))
            {
                dataPipe.Open();
                var envelope = new PipeMessageEnvelope()
                {
                    Label = "PleaseBuildProject"
                };
                dataPipe.Send(envelope);
            }
            _finalizationRequested = true;
        }
Example #7
0
        /// <summary>
        /// Initiates the threads and families calculation.
        /// </summary>
        private void InitiateThreadsAndFamiliesCalculation()
        {
            if (ThreadsLinkingRequested || IsOverlay)
            {
                // Sending special message to ThreadsLinker
                var threadsSection             = FindPipelineSection("ThreadsLinker");
                var threadsSectionDataPipeName = threadsSection.DataPipeName;
                using (var dataPipe = new Pipe(threadsSectionDataPipeName))
                {
                    dataPipe.Open();
                    var envelope = new PipeMessageEnvelope {
                        Label = "EndOfDataMarker"
                    };
                    dataPipe.Send(envelope);
                }
                Tracer.Info("Threads finalization initiated.");
            }

            if (FamiliesLinkingRequested && !ThreadsLinkingRequested && !IsOverlay)
            {
                // Sending special message to FamiliesLinker
                var familiesSection             = FindPipelineSection("FamiliesLinker");
                var familiesSectionDataPipeName = familiesSection.DataPipeName;
                using (var dataPipe = new Pipe(familiesSectionDataPipeName))
                {
                    dataPipe.Open();
                    var envelope = new PipeMessageEnvelope {
                        Label = "EndOfDataMarker"
                    };
                    dataPipe.Send(envelope);
                }
                Tracer.Info("Families calculation initiated.");
            }

            // If both threads and families linking are requested, then we expect threads linker to send EndOfDataMarker to families linker
            FamiliesAndThreadsCalculationsInitiated = true;
        }