Beispiel #1
0
        public void OnInput(Object row)
        {
            if (Log.IsDebugEnabled)
            {
                Log.Debug("Received row for filtering: " + ((Object[])row).Render());
            }

            if (!(row is EventBeanSPI))
            {
                _theEvent.Underlying = row;
            }
            else
            {
                _theEvent = (EventBeanSPI)row;
            }

            var pass = (bool?)_evaluator.Evaluate(new EvaluateParams(_eventsPerStream, true, null));

            if (pass ?? false)
            {
                if (Log.IsDebugEnabled)
                {
                    Log.Debug("Submitting row " + ((Object[])row).Render());
                }

                if (_singleOutputPort)
                {
                    _graphContext.Submit(row);
                }
                else
                {
                    _graphContext.SubmitPort(0, row);
                }
            }
            else
            {
                if (!_singleOutputPort)
                {
                    _graphContext.SubmitPort(1, row);
                }
            }
        }
 public void Next()
 {
     if (_enumerator.MoveNext())
     {
         Object[] next = _enumerator.Current;
         if (Log.IsDebugEnabled)
         {
             Log.Debug("submitting row " + next.Render());
         }
         _graphContext.Submit(next);
     }
     else
     {
         if (Log.IsDebugEnabled)
         {
             Log.Debug("submitting punctuation");
         }
         _graphContext.SubmitSignal(new EPDataFlowSignalFinalMarkerImpl());
     }
 }
Beispiel #3
0
        public void OnInput(object row)
        {
            if (log.IsDebugEnabled)
            {
                log.Debug("Received row for filtering: " + row.RenderAny());
            }

            if (!(row is EventBeanSPI))
            {
                theEvent.UnderlyingSpi = row;
            }
            else
            {
                theEvent = (EventBeanSPI) row;
            }

            object pass = factory.Filter.Evaluate(eventsPerStream, true, agentInstanceContext);
            if (pass != null && true.Equals(pass))
            {
                if (log.IsDebugEnabled)
                {
                    log.Debug("Submitting row " + row.RenderAny());
                }

                if (factory.IsSingleOutputPort)
                {
                    graphContext.Submit(row);
                }
                else
                {
                    graphContext.SubmitPort(0, row);
                }
            }
            else
            {
                if (!factory.IsSingleOutputPort)
                {
                    graphContext.SubmitPort(1, row);
                }
            }
        }
Beispiel #4
0
        public void OnInput(int port, Object theEvent)
        {
            var context = (HttpContext)theEvent;
            var request = context.Request;

            var log = context.Properties["Log"] as ILogger;

            log.Verbose("{@Block} {@Request}", this, request);

            if (request.Uri.StartsWith(Path))
            {
                log.Information("Request Path matched {Path}", Path);

                context.Found = true;
                Emitter.Submit(context);
            }
            else
            {
                log.Information("Request Path not matched {Path}", Path);
            }
        }
Beispiel #5
0
        public void OnInput(int port, Object theEvent)
        {
            var context = (HttpContext)theEvent;
            var request = context.Request;
            var host    = request.Host;

            var log = context.Properties["Log"] as ILogger;

            log.Verbose("{@Block} {@Request}", this, request);

            if (host == Host)
            {
                log.Information("Request Host matched {Host}", Host);

                context.Found = true;
                Emitter.Submit(context);
            }
            else
            {
                log.Information("Request Host not matched {Host}", Host);
            }
        }
        public void Next()
        {
            CurrentCount++;
            if (instructions.Length <= CurrentCount) {
                graphContext.SubmitSignal(new EPDataFlowSignalFinalMarkerImpl());
                return;
            }

            var next = instructions[CurrentCount];
            if (next is CountDownLatch) {
                var latch = (CountDownLatch) next;
                latch.Await();
            }
            else if (next.IsInt64() || next.IsInt32()) {
                Thread.Sleep(next.AsInt32());
            }
            else if (next is EPRuntimeException) {
                var ex = (EPRuntimeException) next;
                throw new EPRuntimeException("Support-graph-source generated exception: " + ex.Message, ex);
            }
            else {
                graphContext.Submit(next);
            }
        }
Beispiel #7
0
        public void Next()
        {
            Object next = emittables.Pop();

            graphContext.Submit(next);
        }
Beispiel #8
0
 public void Submit(object @object)
 {
     dataFlowEmitter.Submit(@object);
 }
Beispiel #9
0
 public void OnSignal(EPDataFlowSignal signal)
 {
     Log.Debug("Received punctuation, submitting totals: " + _aggregate);
     graphContext.Submit(_aggregate);
 }