예제 #1
0
 protected override void PostProcess(
     bool force,
     UniformPair<EventBean[]> newOldEvents,
     UpdateDispatchView childView)
 {
     _postProcessor.Output(force, newOldEvents, childView);
 }
예제 #2
0
 protected virtual void PostProcess(
     bool force,
     UniformPair<EventBean[]> newOldEvents,
     UpdateDispatchView childView)
 {
     OutputStrategyUtil.Output(force, newOldEvents, childView);
 }
예제 #3
0
 public bool RemoveView(View view)
 {
     if (view != ChildView)
     {
         throw new IllegalStateException("Cannot remove child view, view has not been supplied");
     }
     ChildView = null;
     return(true);
 }
예제 #4
0
 public View AddView(View view)
 {
     if (ChildView != null)
     {
         throw new IllegalStateException("Child view has already been supplied");
     }
     ChildView = (UpdateDispatchView)view;
     return(this);
 }
예제 #5
0
 public EPStatementFactoryArgs(
     StatementContext statementContext,
     UpdateDispatchView dispatchChildView,
     StatementResultServiceImpl statementResultService)
 {
     StatementContext = statementContext;
     DispatchChildView = dispatchChildView;
     StatementResultService = statementResultService;
 }
예제 #6
0
 public StatementContext(
     IContainer container,
     ContextRuntimeDescriptor contextRuntimeDescriptor,
     string deploymentId,
     int statementId,
     string statementName,
     string moduleName,
     StatementInformationalsRuntime statementInformationals,
     object userObjectRuntime,
     StatementContextRuntimeServices statementContextRuntimeServices,
     EPStatementHandle epStatementHandle,
     IDictionary<int, FilterSpecActivatable> filterSpecActivatables,
     PatternSubexpressionPoolStmtSvc patternSubexpressionPoolSvc,
     RowRecogStatePoolStmtSvc rowRecogStatePoolStmtSvc,
     ScheduleBucket scheduleBucket,
     StatementAIResourceRegistry statementAIResourceRegistry,
     StatementCPCacheService statementCPCacheService,
     StatementAIFactoryProvider statementAIFactoryProvider,
     StatementResultService statementResultService,
     UpdateDispatchView updateDispatchView,
     FilterService filterService,
     SchedulingService schedulingService,
     InternalEventRouteDest internalEventRouteDest)
 {
     Container = container;
     ContextRuntimeDescriptor = contextRuntimeDescriptor;
     DeploymentId = deploymentId;
     StatementId = statementId;
     StatementName = statementName;
     ModuleName = moduleName;
     StatementInformationals = statementInformationals;
     UserObjectRuntime = userObjectRuntime;
     StatementContextRuntimeServices = statementContextRuntimeServices;
     EpStatementHandle = epStatementHandle;
     FilterSpecActivatables = filterSpecActivatables;
     PatternSubexpressionPoolSvc = patternSubexpressionPoolSvc;
     RowRecogStatePoolStmtSvc = rowRecogStatePoolStmtSvc;
     ScheduleBucket = scheduleBucket;
     StatementAIResourceRegistry = statementAIResourceRegistry;
     StatementCPCacheService = statementCPCacheService;
     StatementAIFactoryProvider = statementAIFactoryProvider;
     StatementResultService = statementResultService;
     UpdateDispatchView = updateDispatchView;
     StatementContextFilterEvalEnv = new StatementContextFilterEvalEnv(
         statementContextRuntimeServices.ImportServiceRuntime,
         statementInformationals.Annotations,
         statementContextRuntimeServices.VariableManagementService,
         statementContextRuntimeServices.TableExprEvaluatorContext);
     this.FilterService = filterService;
     this.SchedulingService = schedulingService;
     this.InternalEventRouteDest = internalEventRouteDest;
 }
예제 #7
0
 public static void Output(
     bool forceUpdate,
     UniformPair<EventBean[]> result,
     UpdateDispatchView finalView)
 {
     var newEvents = result != null ? result.First : null;
     var oldEvents = result != null ? result.Second : null;
     if (newEvents != null || oldEvents != null) {
         finalView.NewResult(result);
     }
     else if (forceUpdate) {
         finalView.NewResult(result);
     }
 }
예제 #8
0
        private static EPStatementSPI MakeStatement(
            UpdateDispatchView dispatchChildView,
            StatementContext statementContext,
            StatementResultServiceImpl statementResultService,
            EPRuntimeSPI epRuntime)
        {
            var epStatement =
                epRuntime.ServicesContext.EpStatementFactory.Statement(new EPStatementFactoryArgs(statementContext, dispatchChildView, statementResultService));
            var info = statementContext.StatementInformationals;

            statementResultService.SetSelectClause(info.SelectClauseTypes, info.SelectClauseColumnNames, info.IsForClauseDelivery, info.GroupDeliveryEval);
            statementResultService.SetContext(epStatement, epRuntime);
            return(epStatement);
        }
예제 #9
0
        public void Output(bool forceUpdate, UniformPair <EventBean[]> result, UpdateDispatchView finalView)
        {
            var newEvents = result != null ? result.First : null;
            var oldEvents = result != null ? result.Second : null;

            // route first
            if (_parent.IsRoute)
            {
                if ((newEvents != null) && (_parent.InsertIntoStreamSelector.Value.IsSelectsIStream()))
                {
                    Route(newEvents, _agentInstanceContext);
                }

                if ((oldEvents != null) && (_parent.InsertIntoStreamSelector.Value.IsSelectsRStream()))
                {
                    Route(oldEvents, _agentInstanceContext);
                }
            }

            // discard one side of results
            if (_parent.SelectStreamDirEnum == SelectClauseStreamSelectorEnum.RSTREAM_ONLY)
            {
                newEvents = oldEvents;
                oldEvents = null;
            }
            else if (_parent.SelectStreamDirEnum == SelectClauseStreamSelectorEnum.ISTREAM_ONLY)
            {
                oldEvents = null;       // since the insert-into may require rstream
            }

            // dispatch
            if (newEvents != null || oldEvents != null)
            {
                finalView.NewResult(new UniformPair <EventBean[]>(newEvents, oldEvents));
            }
            else if (forceUpdate)
            {
                finalView.NewResult(new UniformPair <EventBean[]>(null, null));
            }
        }
예제 #10
0
 public void RemoveAllViews()
 {
     ChildView = null;
 }
예제 #11
0
 public void RemoveAll(UpdateDispatchView updateDispatchView) {
     var dispatchables = dispatchStateThreadLocal.GetOrCreate();
     dispatchables.RemoveWhere(
         dispatchable => dispatchable.View == updateDispatchView,
         dispatchable => dispatchable.Cancelled());
 }