Exemple #1
0
        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);
        }
Exemple #2
0
 public void AddDispatch(
     NamedWindowConsumerLatchFactory latchFactory,
     NamedWindowDeltaData delta,
     IDictionary<EPStatementAgentInstanceHandle, IList<NamedWindowConsumerView>> consumers)
 {
     var latch = latchFactory.NewLatch(delta, consumers);
     threadLocal.GetOrCreate().Dispatches.Add(latch);
 }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
        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;
        }
Exemple #5
0
 public abstract void AddDispatches(
     NamedWindowConsumerLatchFactory latchFactory,
     IDictionary<EPStatementAgentInstanceHandle, IList<NamedWindowConsumerView>> consumersInContext,
     NamedWindowDeltaData delta,
     AgentInstanceContext agentInstanceContext);