Package com.espertech.esper.client

Examples of com.espertech.esper.client.EPException


        {
            return engineImportService.resolveAggregation(functionName);
        }
        catch (EngineImportUndefinedException e)
        {
            throw new EPException("Failed to make new aggregation function instance for '" + functionName + "'", e);
        }
        catch (EngineImportException e)
        {
            throw new EPException("Failed to make new aggregation function instance for '" + functionName + "'", e);
        }
    }
View Full Code Here


            {
                pattern = Pattern.compile(patternText);
            }
            catch (PatternSyntaxException ex)
            {
                throw new EPException("Error compiling regex pattern '" + patternText + '\'', ex);
            }
        }
        else
        {
            if (!isConstantPattern)
            {
                String patternText = (String) evaluators[1].evaluate(eventsPerStream, isNewData, exprEvaluatorContext);
                if (patternText == null)
                {
                    if (InstrumentationHelper.ENABLED) { InstrumentationHelper.get().aExprRegexp(null);}
                    return null;
                }
                try
                {
                    pattern = Pattern.compile(patternText);
                }
                catch (PatternSyntaxException ex)
                {
                    throw new EPException("Error compiling regex pattern '" + patternText + '\'', ex);
                }
            }
        }

        Object evalValue = evaluators[0].evaluate(eventsPerStream, isNewData, exprEvaluatorContext);
View Full Code Here

        }

        VirtualDataWindowLookup index = dataExternal.getLookup(new VirtualDataWindowLookupContext(noopTable.getHashAccess(), noopTable.getBtreeAccess()));
        checkIndex(index);
        if (index == null) {
            throw new EPException("Exception obtaining index from virtual data window '" + namedWindowName + "'");
        }

        Set<EventBean> events = null;
        try {
            events = index.lookup(keys);
View Full Code Here

        return events;
    }

    private void checkIndex(VirtualDataWindowLookup index) {
        if (index == null) {
            throw new EPException("Exception obtaining index lookup from virtual data window, the implementation has returned a null index");
        }
    }
View Full Code Here

    public Guard makeGuard(PatternContext context, MatchedEventMap matchedEventMap, Quitable quitable, EvalStateNodeNumber stateNodeId, Object guardState)
    {
        Object millisecondVal = PatternExpressionUtil.evaluate("Timer-Within-Or-Max-Count guard", matchedEventMap, millisecondsExpr, convertor, context);
        if (null == millisecondVal) {
            throw new EPException("Timer-within-or-max first parameter evaluated to a null-value");
        }
        Number param = (Number) millisecondVal;
        long milliseconds = Math.round(1000d * param.doubleValue());

        Object numCountToVal = PatternExpressionUtil.evaluate("Timer-Within-Or-Max-Count guard", matchedEventMap, numCountToExpr, convertor,context);
        if (null == numCountToVal) {
            throw new EPException("Timer-within-or-max second parameter evaluated to a null-value");
        }
        Integer numCountTo = (Integer) numCountToVal;
        return new TimerWithinOrMaxCountGuard(milliseconds, numCountTo, quitable);
    }
View Full Code Here

    public Object evaluate(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
    {
        if (timeProvider == null)
        {
            throw new EPException("Expression node has not been validated");
        }
        if (this.getChildNodes().isEmpty())
        {
            return new CronParameter(cronOperator, null, timeProvider.getTime());
        }
View Full Code Here

        Set<String> inherited = new LinkedHashSet<String>();
        for (int i = 0; i < node.getChildCount(); i++) {
            Tree p = node.getChild(i);
            if (p.getType() == CREATE_SCHEMA_EXPR_INH) {
                if (!p.getChild(0).getText().toLowerCase().equals("inherits")) {
                    throw new EPException("Expected 'inherits' keyword after create-schema clause but encountered '" + p.getChild(0).getText() + "'");
                }
                for (int j = 1; j < p.getChildCount(); j++) {
                    if (p.getChild(j).getType() == EXPRCOL) {
                        for (int k = 0; k < p.getChild(j).getChildCount(); k++) {
                            inherited.add(p.getChild(j).getChild(k).getText());
                        }
                    }
                }
            }
        }

        // get qualifier
        boolean variant = false;
        for (int i = 0; i < node.getChildCount(); i++) {
            Tree p = node.getChild(i);
            if (p.getType() == CREATE_SCHEMA_EXPR_QUAL) {
                if (!p.getChild(0).getText().toLowerCase().equals("variant")) {
                    throw new EPException("Expected 'variant' keyword after create-schema clause but encountered '" + p.getChild(0).getText() + "'");
                }
                variant = true;
            }
        }
        statementSpec.getStreamSpecs().add(new FilterStreamSpecRaw(new FilterSpecRaw(Object.class.getName(), Collections.<ExprNode>emptyList(), null), Collections.<ViewSpec>emptyList(), null, new StreamSpecOptions()));
View Full Code Here

            processMatches(eventBean);
        }
        catch (RuntimeException ex)
        {
            matchesArrayThreadLocal.get().clear();
            throw new EPException(ex);
        }
        finally
        {
            unisolatedServices.getEventProcessingRWLock().releaseReadLock();
        }
View Full Code Here

        {
            unisolatedServices.getDispatchService().dispatch();
        }
        catch (RuntimeException ex)
        {
            throw new EPException(ex);
        }
    }
View Full Code Here

        {
            return engineImportService.resolveAggregation(functionName);
        }
        catch (EngineImportUndefinedException e)
        {
            throw new EPException("Failed to make new aggregation function instance for '" + functionName + "'", e);
        }
        catch (EngineImportException e)
        {
            throw new EPException("Failed to make new aggregation function instance for '" + functionName + "'", e);
        }
    }
View Full Code Here

TOP

Related Classes of com.espertech.esper.client.EPException

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.