public override void Apply(EventBean matchingEvent, EventBean[] eventsPerStream, TableStateInstance tableStateInstance, TableOnMergeViewChangeHandler changeHandlerAdded, TableOnMergeViewChangeHandler changeHandlerRemoved, ExprEvaluatorContext exprEvaluatorContext) { if (changeHandlerRemoved != null) { changeHandlerRemoved.Add(matchingEvent, eventsPerStream, false, exprEvaluatorContext); } _tableUpdateStrategy.UpdateTable(Collections.SingletonList(matchingEvent), tableStateInstance, eventsPerStream, exprEvaluatorContext); if (changeHandlerAdded != null) { changeHandlerAdded.Add(matchingEvent, eventsPerStream, false, exprEvaluatorContext); } }
public override void Apply( EventBean matchingEvent, EventBean[] eventsPerStream, TableInstance tableStateInstance, OnExprViewTableChangeHandler changeHandlerAdded, OnExprViewTableChangeHandler changeHandlerRemoved, AgentInstanceContext agentInstanceContext) { changeHandlerRemoved?.Add(matchingEvent, eventsPerStream, false, agentInstanceContext); tableUpdateStrategy.UpdateTable( Collections.SingletonList(matchingEvent), tableStateInstance, eventsPerStream, agentInstanceContext); changeHandlerAdded?.Add(matchingEvent, eventsPerStream, false, agentInstanceContext); }
public override void HandleMatching(EventBean[] triggerEvents, EventBean[] matchingEvents) { if (InstrumentationHelper.ENABLED) { InstrumentationHelper.Get().QInfraOnAction(OnTriggerType.ON_UPDATE, triggerEvents, matchingEvents); } EventBean[] eventsPerStream = new EventBean[3]; bool postUpdates = parent.StatementResultService.IsMakeNatural || parent.StatementResultService.IsMakeSynthetic; EventBean[] postedOld = null; if (postUpdates) { postedOld = TableOnViewUtil.ToPublic(matchingEvents, parent.TableMetadata, triggerEvents, false, base.ExprEvaluatorContext); } TableUpdateStrategy tableUpdateStrategy = parent.TableUpdateStrategy; foreach (EventBean triggerEvent in triggerEvents) { eventsPerStream[1] = triggerEvent; tableUpdateStrategy.UpdateTable(matchingEvents, TableStateInstance, eventsPerStream, exprEvaluatorContext); } // The on-delete listeners receive the events deleted, but only if there is interest if (postUpdates) { EventBean[] postedNew = TableOnViewUtil.ToPublic(matchingEvents, parent.TableMetadata, triggerEvents, true, base.ExprEvaluatorContext); UpdateChildren(postedNew, postedOld); } if (InstrumentationHelper.ENABLED) { InstrumentationHelper.Get().AInfraOnAction(); } }