Example #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);
                }
            }
        }
Example #2
0
 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());
     }
 }
Example #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);
                }
            }
        }
Example #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);
            }
        }
Example #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);
            }
        }
Example #6
0
        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);
            }
        }
Example #7
0
        public void Next()
        {
            Object next = emittables.Pop();

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