Package com.espertech.esper.schedule

Examples of com.espertech.esper.schedule.ScheduleHandleCallback


        this.msecIntervalSize = msecIntervalSize;
        this.viewUpdatedCollection = viewUpdatedCollection;

        this.scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();

        ScheduleHandleCallback callback = new ScheduleHandleCallback() {
            public void scheduledTrigger(ExtensionServicesContext extensionServicesContext)
            {
                if (InstrumentationHelper.ENABLED) { InstrumentationHelper.get().qViewScheduledEval(TimeAccumView.this, TimeAccumView.this.factory.getViewName());}
                TimeAccumView.this.sendRemoveStream();
                if (InstrumentationHelper.ENABLED) { InstrumentationHelper.get().aViewScheduledEval();}
View Full Code Here


        stmtCallbacks.clear();
        for (int i = 0; i < entryCount; i++)    // need to use the size of the collection
        {
            EPStatementHandleCallback handleCallback = (EPStatementHandleCallback) matchArray[i];
            EPStatementHandle handle = handleCallback.getEpStatementHandle();
            ScheduleHandleCallback callback = handleCallback.getScheduleCallback();

            Object entry = stmtCallbacks.get(handle);

            // This statement has not been encountered before
            if (entry == null)
            {
                stmtCallbacks.put(handle, callback);
                continue;
            }

            // This statement has been encountered once before
            if (entry instanceof ScheduleHandleCallback)
            {
                ScheduleHandleCallback existingCallback = (ScheduleHandleCallback) entry;
                ArrayDeque<ScheduleHandleCallback> entries = new ArrayDeque<ScheduleHandleCallback>();
                entries.add(existingCallback);
                entries.add(callback);
                stmtCallbacks.put(handle, entries);
                continue;
View Full Code Here

                    callback.scheduledTrigger(services.getExtensionServicesContext());
                }
            }
            else
            {
                ScheduleHandleCallback callback = (ScheduleHandleCallback) callbackObject;
                callback.scheduledTrigger(services.getExtensionServicesContext());
            }

            // internal join processing, if applicable
            handle.internalDispatch(exprEvaluatorContext);
        }
View Full Code Here

        this.isSelectAsksMultimatches = isSelectAsksMultimatches;

        if (matchRecognizeSpec.getInterval() != null)
        {
            scheduleSlot = statementContext.getScheduleBucket().allocateSlot();
            ScheduleHandleCallback callback = new ScheduleHandleCallback() {
                public void scheduledTrigger(ExtensionServicesContext extensionServicesContext)
                {
                    EventRowRegexNFAView.this.triggered();
                }
            };
            handle = new EPStatementHandleCallback(statementContext.getEpStatementHandle(), callback);
            schedule = new TreeMap<Long, Object>();
        }
        else
        {
            scheduleSlot = null;
            handle = null;
            schedule = null;
        }

        this.windowMatchedEventset = new LinkedHashSet<EventBean>();

        // handle "previous" function nodes (performance-optimized for direct index access)
        RegexPartitionStateRandomAccessGetter randomAccessByIndexGetter;
        if (!callbacksPerIndex.isEmpty())
        {
            // Build an array of indexes
            int[] randomAccessIndexesRequested = new int[callbacksPerIndex.size()];
            int count = 0;
            for (Map.Entry<Integer, List<ExprPreviousMatchRecognizeNode>> entry : callbacksPerIndex.entrySet())
            {
                randomAccessIndexesRequested[count] = entry.getKey();
                count++;
            }
            randomAccessByIndexGetter = new RegexPartitionStateRandomAccessGetter(randomAccessIndexesRequested, isUnbound);

            // Since an expression such as "prior(2, price), prior(8, price)" translates into {2, 8} the relative index is {0, 1}.
            // Map the expression-supplied index to a relative index
            count = 0;
            for (Map.Entry<Integer, List<ExprPreviousMatchRecognizeNode>> entry : callbacksPerIndex.entrySet())
            {
                for (ExprPreviousMatchRecognizeNode callback : entry.getValue())
                {
                    callback.setGetter(randomAccessByIndexGetter);
                    callback.setAssignedIndex(count);
                }
                count++;
            }
        }
        else
View Full Code Here

        stmtCallbacks.clear();
        for (int i = 0; i < entryCount; i++)    // need to use the size of the collection
        {
            EPStatementHandleCallback handleCallback = (EPStatementHandleCallback) matchArray[i];
            EPStatementHandle handle = handleCallback.getEpStatementHandle();
            ScheduleHandleCallback callback = handleCallback.getScheduleCallback();

            Object entry = stmtCallbacks.get(handle);

            // This statement has not been encountered before
            if (entry == null)
            {
                stmtCallbacks.put(handle, callback);
                continue;
            }

            // This statement has been encountered once before
            if (entry instanceof ScheduleHandleCallback)
            {
                ScheduleHandleCallback existingCallback = (ScheduleHandleCallback) entry;
                ArrayDeque<ScheduleHandleCallback> entries = new ArrayDeque<ScheduleHandleCallback>();
                entries.add(existingCallback);
                entries.add(callback);
                stmtCallbacks.put(handle, entries);
                continue;
View Full Code Here

            log.debug(".scheduleCallback Scheduled new callback for " +
                    " afterMsec=" + 0 +
                    " now=" + current);
        }

        ScheduleHandleCallback callback = new ScheduleHandleCallback() {
            public void scheduledTrigger(ExtensionServicesContext extensionServicesContext)
            {
                OutputConditionExpression.this.isCallbackScheduled = false;
                OutputConditionExpression.this.outputCallback.continueOutputProcessing(true, true);
                resetBuiltinProperties();
View Full Code Here

    private void scheduleCallback()
    {
        long afterMSec = this.msecIntervalSize;

        ScheduleHandleCallback callback = new ScheduleHandleCallback() {
            public void scheduledTrigger(ExtensionServicesContext extensionServicesContext)
            {
                if (InstrumentationHelper.ENABLED) { InstrumentationHelper.get().qViewScheduledEval(FirstTimeView.this, timeFirstViewFactory.getViewName());}
                FirstTimeView.this.isClosed = true;
                internalHandleClosed();
View Full Code Here

                        variableService.unregisterCallback(reader.getVariableNumber(), ExpressionViewBase.this);
                    }
                });
            }

            ScheduleHandleCallback callback = new ScheduleHandleCallback() {
                public void scheduledTrigger(ExtensionServicesContext extensionServicesContext)
                {
                    if (InstrumentationHelper.ENABLED) { InstrumentationHelper.get().qViewScheduledEval(ExpressionViewBase.this, getViewName());}
                    scheduleCallback();
                    if (InstrumentationHelper.ENABLED) { InstrumentationHelper.get().aViewScheduledEval();}
View Full Code Here

        this.millisecondsBeforeExpiry = millisecondsBeforeExpiry;
        this.viewUpdatedCollection = viewUpdatedCollection;
        this.scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();
        this.timeWindow = new TimeWindow(agentInstanceContext.isRemoveStream());

        ScheduleHandleCallback callback = new ScheduleHandleCallback() {
            public void scheduledTrigger(ExtensionServicesContext extensionServicesContext)
            {
                if (InstrumentationHelper.ENABLED) { InstrumentationHelper.get().qViewScheduledEval(TimeWindowView.this, TimeWindowView.this.timeWindowViewFactory.getViewName());}
                TimeWindowView.this.expire();
                if (InstrumentationHelper.ENABLED) { InstrumentationHelper.get().aViewScheduledEval();}
View Full Code Here

    protected void scheduleCallback()
    {
        long current = agentInstanceContext.getStatementContext().getSchedulingService().getTime();
        long afterMSec = TimeBatchView.computeWaitMSec(current, this.currentReferencePoint, this.msecIntervalSize);

        ScheduleHandleCallback callback = new ScheduleHandleCallback() {
            public void scheduledTrigger(ExtensionServicesContext extensionServicesContext)
            {
                if (InstrumentationHelper.ENABLED) { InstrumentationHelper.get().qViewScheduledEval(TimeBatchViewRStream.this, timeBatchViewFactory.getViewName());}
                TimeBatchViewRStream.this.sendBatch();
                if (InstrumentationHelper.ENABLED) { InstrumentationHelper.get().aViewScheduledEval();}
View Full Code Here

TOP

Related Classes of com.espertech.esper.schedule.ScheduleHandleCallback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.