public override void Update( EventBean[] newData, EventBean[] oldData) { // Only old data (remove stream) needs to be removed from indexes (kept by root view), if any if (oldData != null) { _rootViewInstance.RemoveOldData(oldData); _numberOfEvents -= oldData.Length; } if (newData != null && !TailView.IsParentBatchWindow) { _rootViewInstance.AddNewData(newData); } if (newData != null) { _numberOfEvents += newData.Length; } // Post to child views, only if there are listeners or subscribers if (TailView.StatementResultService.IsMakeNatural || TailView.StatementResultService.IsMakeSynthetic) { Child.Update(newData, oldData); } var delta = new NamedWindowDeltaData(newData, oldData); TailView.AddDispatches(_latchFactory, _consumersInContext, delta, AgentInstanceContext); }
public void AddDispatch( NamedWindowConsumerLatchFactory latchFactory, NamedWindowDeltaData delta, IDictionary<EPStatementAgentInstanceHandle, IList<NamedWindowConsumerView>> consumers) { var latch = latchFactory.NewLatch(delta, consumers); threadLocal.GetOrCreate().Dispatches.Add(latch); }
public override void AddDispatches( NamedWindowConsumerLatchFactory latchFactory, IDictionary<EPStatementAgentInstanceHandle, IList<NamedWindowConsumerView>> consumersInContext, NamedWindowDeltaData delta, AgentInstanceContext agentInstanceContext) { if (!consumersInContext.IsEmpty()) { namedWindowDispatchService.AddDispatch(latchFactory, delta, consumersInContext); } if (!consumersNonContext.IsEmpty()) { namedWindowDispatchService.AddDispatch(latchFactory, delta, consumersNonContext); } }
public LinkedHashMap<NamedWindowConsumerView, NamedWindowDeltaData> GetDeltaPerConsumer( object perStmtObj, EPStatementAgentInstanceHandle handle) { var list = (IList<NamedWindowConsumerLatch>) perStmtObj; var deltaPerConsumer = new LinkedHashMap<NamedWindowConsumerView, NamedWindowDeltaData>(); foreach (var unit in list) { // for each unit foreach (var consumerView in unit.DispatchTo.Get(handle)) { // each consumer var deltaForConsumer = deltaPerConsumer.Get(consumerView); if (deltaForConsumer == null) { deltaPerConsumer.Put(consumerView, unit.DeltaData); } else { var aggregated = new NamedWindowDeltaData(deltaForConsumer, unit.DeltaData); deltaPerConsumer.Put(consumerView, aggregated); } } } return deltaPerConsumer; }
public abstract void AddDispatches( NamedWindowConsumerLatchFactory latchFactory, IDictionary<EPStatementAgentInstanceHandle, IList<NamedWindowConsumerView>> consumersInContext, NamedWindowDeltaData delta, AgentInstanceContext agentInstanceContext);