Пример #1
0
        private EPStageImpl AllocateStage(
            string stageUri,
            int stageId,
            long stageTime)
        {
            StageSpecificServices  stageSpecificServices = _services.StageRecoveryService.MakeSpecificServices(stageId, stageUri, _services);
            EPStageEventServiceSPI eventService          = _services.StageRecoveryService.MakeEventService(stageSpecificServices, stageId, stageUri, _services);

            stageSpecificServices.Initialize(eventService);
            eventService.InternalEventRouter = stageSpecificServices.InternalEventRouter;

            eventService.SpecificServices.SchedulingService.Time = stageTime;
            EPStageDeploymentServiceImpl deploymentService = new EPStageDeploymentServiceImpl(stageUri, _services, eventService.SpecificServices);
            DestroyCallback stageDestroyCallback           = new ProxyDestroyCallback()
            {
                ProcDestroy = () => {
                    lock (_stages) {
                        _services.StageRecoveryService.StageDestroy(stageUri, stageId);
                        _stages.Remove(stageUri);
                    }
                },
            };

            return(new EPStageImpl(stageUri, stageId, _services, eventService.SpecificServices, eventService, deploymentService, stageDestroyCallback));
        }
Пример #2
0
 public override EPStageEventServiceSPI MakeEventService(
     StageSpecificServices stageSpecificServices,
     int stageId,
     string stageUri,
     EPServicesContext servicesContext)
 {
     return(new EPStageEventServiceImpl(stageSpecificServices, servicesContext.StageRuntimeServices, stageUri));
 }
 public EPStageDeploymentServiceImpl(
     string stageUri,
     EPServicesContext servicesContext,
     StageSpecificServices stageSpecificServices)
 {
     this.stageUri = stageUri;
     this.servicesContext = servicesContext;
     this.stageSpecificServices = stageSpecificServices;
 }
Пример #4
0
 public EPStageImpl(
     string stageUri,
     int stageId,
     EPServicesContext servicesContext,
     StageSpecificServices stageSpecificServices,
     EPStageEventServiceSPI eventServiceStage,
     EPStageDeploymentServiceImpl deploymentServiceStage,
     DestroyCallback stageDestroyCallback)
 {
     _stageUri               = stageUri;
     _stageId                = stageId;
     _servicesContext        = servicesContext;
     _stageSpecificServices  = stageSpecificServices;
     _eventServiceStage      = eventServiceStage;
     _deploymentServiceStage = deploymentServiceStage;
     _stageDestroyCallback   = stageDestroyCallback;
 }
Пример #5
0
        public void RecoverDeployment(
            string stageUri,
            DeploymentInternal deployment)
        {
            string deploymentId = deployment.DeploymentId;

            _services.DeploymentLifecycleService.RemoveDeployment(deploymentId);
            _stages.Get(stageUri).StageSpecificServices.DeploymentLifecycleService.AddDeployment(deploymentId, deployment);

            StageSpecificServices stageSpecificServices = _stages.Get(stageUri).EventServiceSPI.SpecificServices;

            foreach (EPStatement statement in deployment.Statements)
            {
                EPStatementSPI spi = (EPStatementSPI)statement;
                UpdateStatement(spi.StatementContext, stageSpecificServices);

                if (Equals(spi.GetProperty(StatementProperty.STATEMENTTYPE), StatementType.UPDATE))
                {
                    _services.InternalEventRouter.MovePreprocessing(spi.StatementContext, stageSpecificServices.InternalEventRouter);
                }
            }
        }
Пример #6
0
 public abstract EPStageEventServiceSPI MakeEventService(
     StageSpecificServices stageSpecificServices,
     int stageId,
     string stageUri,
     EPServicesContext servicesContext);