Changeset 275020089c5881bce207b67b6e3ce7e4685ccb51

Show
Ignore:
Timestamp:
02/16/12 18:46:19 (2 years ago)
Author:
Brian Clapper <bclapper@omniti.com>
git-committer:
Brian Clapper <bclapper@omniti.com> 1329417979 -0500
git-parent:

[c4fc37fcf1cb3f31782b792228a0b35e4cdf2acf]

git-author:
Brian Clapper <bclapper@omniti.com> 1329417979 -0500
Message:

upgrade to esper 4.5, fix internal 'API' changes to do so

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/java/Makefile.in

    rf247f91 r2750200  
    8181J_CLASS = $(J_JAVA:.java=*.class) 
    8282 
    83 R_SUPPORT=lib/activemq-all-5.2.0.jar lib/antlr-runtime-3.1.1.jar lib/esper-4.1.0.jar \ 
     83R_SUPPORT=lib/activemq-all-5.2.0.jar lib/antlr-runtime-3.1.1.jar lib/esper-4.5.0.jar \ 
    8484        lib/log4j-1.2.15.jar lib/spring-beans-2.5.5.jar lib/spring-context-2.5.5.jar \ 
    8585        lib/cglib-nodep-2.2.jar lib/commons-pool-1.4.jar lib/commons-dbcp-1.2.2.jar \ 
  • src/java/com/omniti/reconnoiter/esper/CounterView.java

    r54eb3fe r2750200  
    1212 
    1313import com.omniti.reconnoiter.esper.DeriveView; 
    14 import com.espertech.esper.core.StatementContext; 
    1514import com.espertech.esper.epl.expression.ExprNode; 
    1615import com.espertech.esper.view.View; 
     16import com.espertech.esper.client.EventType; 
     17import com.espertech.esper.core.context.util.AgentInstanceContext; 
     18import com.espertech.esper.view.stat.StatViewAdditionalProps; 
    1719 
    1820/** 
     
    2123public class CounterView extends DeriveView 
    2224{ 
    23     public CounterView(StatementContext statementContext, ExprNode expressionX, ExprNode expressionY
     25    public CounterView(AgentInstanceContext agentInstanceContext, ExprNode expressionX, ExprNode expressionY, EventType eventType, StatViewAdditionalProps additionalProps
    2426    { 
    25         super(statementContext, expressionX, expressionY); 
     27        super(agentInstanceContext, expressionX, expressionY, eventType, additionalProps); 
    2628    } 
    27     public View cloneView(StatementContext statementContext
     29    public View cloneView(
    2830    { 
    29         return new CounterView(statementContext, this.expressionX, this.expressionY); 
     31        return new CounterView(this.agentInstanceContext, this.expressionX, this.expressionY, this.eventType, this.additionalProps); 
    3032    } 
    3133    protected NoitDerivePoint subtract(NoitDerivePoint a, NoitDerivePoint b) 
  • src/java/com/omniti/reconnoiter/esper/CounterViewFactory.java

    r69c4c69 r2750200  
    1717import com.espertech.esper.view.ViewFactory; 
    1818import com.espertech.esper.view.View; 
    19 import com.espertech.esper.core.StatementContext; 
     19import com.espertech.esper.view.stat.StatViewAdditionalProps; 
     20import com.espertech.esper.core.service.StatementContext; 
     21import com.espertech.esper.core.context.util.AgentInstanceViewFactoryChainContext; 
    2022 
    2123public class CounterViewFactory extends ViewFactorySupport { 
    2224    private ViewFactoryContext viewFactoryContext; 
    2325    private List<ExprNode> viewParameters; 
     26    private int streamNumber; 
    2427    private ExprNode timestampExpression; 
    2528    private ExprNode valueExpression; 
     29    protected EventType eventType; 
     30    protected StatViewAdditionalProps additionalProps; 
    2631 
    2732    public void setViewParameters(ViewFactoryContext viewFactoryContext,  
     
    3338        } 
    3439        this.viewParameters = viewParameters; 
     40        this.streamNumber = viewFactoryContext.getStreamNum(); 
    3541    } 
    3642 
     
    5864                "View requires long-typed or double-typed values for in parameter 2"); 
    5965        } 
     66 
     67        additionalProps = StatViewAdditionalProps.make(validatedNodes, 2, parentEventType); 
     68        eventType = ExactRegressionLinestView.createEventType(statementContext, additionalProps, streamNumber); 
    6069    } 
    61     public View makeView(StatementContext statementContext) { 
    62         return new CounterView(statementContext, timestampExpression, valueExpression); 
     70 
     71    public View makeView(AgentInstanceViewFactoryChainContext agentInstanceViewFactoryContext) { 
     72        return new CounterView(agentInstanceViewFactoryContext.getAgentInstanceContext(), timestampExpression, valueExpression, eventType, additionalProps); 
    6373    } 
    6474 
  • src/java/com/omniti/reconnoiter/esper/DeriveView.java

    r69c4c69 r2750200  
    1313 
    1414import com.espertech.esper.collection.SingleEventIterator; 
    15 import com.espertech.esper.core.StatementContext; 
     15import com.espertech.esper.core.service.StatementContext; 
    1616import com.espertech.esper.epl.expression.ExprNode; 
    1717import com.espertech.esper.client.EventBean; 
     
    2121import com.espertech.esper.view.View; 
    2222import com.espertech.esper.view.ViewSupport; 
     23import com.espertech.esper.core.context.util.AgentInstanceContext; 
     24import com.espertech.esper.view.stat.StatViewAdditionalProps; 
    2325 
    2426import java.util.Iterator; 
     
    3234{ 
    3335    private StatementContext statementContext; 
     36    protected AgentInstanceContext agentInstanceContext; 
    3437    protected ExprNode expressionX; 
    3538    protected ExprNode expressionY; 
     39    protected final EventType eventType; 
    3640    private boolean isDouble; 
    3741    private WeightedValueBean lastWVBean; 
    3842    private NoitDerivePoint lastpoint; 
     43    protected final StatViewAdditionalProps additionalProps; 
    3944 
    4045    /** 
     
    4449     * @param deriveViewFactory for copying this view in a group-by 
    4550     */ 
    46     public DeriveView(StatementContext statementContext, ExprNode expressionX, ExprNode expressionY
     51    public DeriveView(AgentInstanceContext agentInstanceContext, ExprNode expressionX, ExprNode expressionY, EventType eventType, StatViewAdditionalProps additionalProps
    4752    { 
    48         this.statementContext = statementContext; 
     53        this.agentInstanceContext = agentInstanceContext; 
     54        this.statementContext = agentInstanceContext.getStatementContext(); 
    4955        this.expressionX = expressionX; 
    5056        this.expressionY = expressionY; 
     57        this.eventType = eventType; 
     58        this.additionalProps = additionalProps; 
    5159        isDouble = (expressionY.getExprEvaluator().getType() != double.class || expressionY.getExprEvaluator().getType() != Double.class); 
    5260    } 
    5361 
    54     public View cloneView(StatementContext statementContext
     62    public View cloneView(
    5563    { 
    56         return new DeriveView(statementContext, this.expressionX, this.expressionY); 
     64        return new DeriveView(this.agentInstanceContext, this.expressionX, this.expressionY, this.eventType, this.additionalProps); 
    5765    } 
    5866 
     
    8896            for ( EventBean pointb : newData ) { 
    8997                EventBean eventsPerStream[] = { pointb }; 
    90                 Number NX = (Number) expressionX.getExprEvaluator().evaluate(eventsPerStream, true, statementContext); 
     98                Number NX = (Number) expressionX.getExprEvaluator().evaluate(eventsPerStream, true, agentInstanceContext); 
    9199                if(NX == null) continue; 
    92                 Number NY = (Number) expressionY.getExprEvaluator().evaluate(eventsPerStream, true, statementContext); 
     100                Number NY = (Number) expressionY.getExprEvaluator().evaluate(eventsPerStream, true, agentInstanceContext); 
    93101                if(NY == null) continue; 
    94102                NoitDerivePoint point = new NoitDerivePoint(); 
  • src/java/com/omniti/reconnoiter/esper/DeriveViewFactory.java

    r69c4c69 r2750200  
    1717import com.espertech.esper.view.ViewFactory; 
    1818import com.espertech.esper.view.View; 
    19 import com.espertech.esper.core.StatementContext; 
     19import com.espertech.esper.view.stat.StatViewAdditionalProps; 
     20import com.espertech.esper.core.service.StatementContext; 
     21import com.espertech.esper.core.context.util.AgentInstanceViewFactoryChainContext; 
    2022 
    2123public class DeriveViewFactory extends ViewFactorySupport { 
    2224    private ViewFactoryContext viewFactoryContext; 
    2325    private List<ExprNode> viewParameters; 
     26    private int streamNumber; 
    2427    private ExprNode timestampExpression; 
    2528    private ExprNode valueExpression; 
     29    protected EventType eventType; 
     30    protected StatViewAdditionalProps additionalProps; 
    2631 
    2732    public void setViewParameters(ViewFactoryContext viewFactoryContext,  
     
    3338        } 
    3439        this.viewParameters = viewParameters; 
     40        this.streamNumber = viewFactoryContext.getStreamNum(); 
    3541    } 
    3642 
     
    5864                "View requires long-typed or double-typed values for in parameter 2"); 
    5965        } 
     66 
     67        additionalProps = StatViewAdditionalProps.make(validatedNodes, 2, parentEventType); 
     68        eventType = ExactRegressionLinestView.createEventType(statementContext, additionalProps, streamNumber); 
    6069    } 
    61     public View makeView(StatementContext statementContext) { 
    62         return new DeriveView(statementContext, timestampExpression, valueExpression); 
     70 
     71    public View makeView(AgentInstanceViewFactoryChainContext agentInstanceViewFactoryContext) { 
     72        return new DeriveView(agentInstanceViewFactoryContext.getAgentInstanceContext(), timestampExpression, valueExpression, eventType, additionalProps); 
    6373    } 
    6474 
  • src/java/com/omniti/reconnoiter/esper/ExactBaseBivariateStatisticsView.java

    r69c4c69 r2750200  
    1111package com.omniti.reconnoiter.esper; 
    1212 
     13import com.espertech.esper.client.EventBean; 
     14import com.espertech.esper.client.EventType; 
    1315import com.espertech.esper.collection.SingleEventIterator; 
    14 import com.espertech.esper.core.StatementContext; 
     16import com.espertech.esper.core.context.util.AgentInstanceContext; 
     17import com.espertech.esper.epl.expression.ExprEvaluator; 
    1518import com.espertech.esper.epl.expression.ExprNode; 
    16 import com.espertech.esper.client.EventBean
     19import com.espertech.esper.event.EventAdapterService
    1720import com.espertech.esper.view.ViewSupport; 
     21import com.espertech.esper.view.stat.StatViewAdditionalProps; 
    1822 
    1923import java.util.Iterator; 
     
    2832 
    2933    private ExprNode expressionX; 
     34    private ExprEvaluator expressionXEval; 
    3035    private ExprNode expressionY; 
     36    private ExprEvaluator expressionYEval; 
    3137    private boolean  isDouble; 
    3238    private EventBean[] eventsPerStream = new EventBean[1]; 
    3339 
    34     protected StatementContext statementContext; 
     40    protected AgentInstanceContext agentInstanceContext; 
     41    protected final StatViewAdditionalProps additionalProps; 
    3542 
    3643    private EventBean lastNewEvent; 
     44    protected final EventType eventType; 
    3745 
    38     public ExactBaseBivariateStatisticsView(StatementContext statementContext, 
    39                                             ExactRegressionBean statisticsBean, 
    40                                             ExprNode expressionX, 
    41                                             ExprNode expressionY) 
     46    public ExactBaseBivariateStatisticsView(AgentInstanceContext agentInstanceContext, 
     47                                       ExprNode expressionX, 
     48                                       ExprNode expressionY, 
     49                                       EventType eventType, 
     50                                       StatViewAdditionalProps additionalProps 
     51                                       ) 
    4252    { 
    43         this.statementContext = statementContext; 
    44         this.statisticsBean = statisticsBean; 
     53        this.agentInstanceContext = agentInstanceContext; 
    4554        this.expressionX = expressionX; 
     55        this.expressionXEval = expressionX.getExprEvaluator(); 
    4656        this.expressionY = expressionY; 
    47         isDouble = (expressionY.getExprEvaluator().getType() != double.class || expressionY.getExprEvaluator().getType() != Double.class); 
     57        this.expressionYEval = expressionY.getExprEvaluator(); 
     58        this.eventType = eventType; 
     59        this.additionalProps = additionalProps; 
    4860    } 
    4961 
     
    6678            { 
    6779                eventsPerStream[0] = newData[i]; 
    68                 BigDecimal X = new BigDecimal(((Number) expressionX.getExprEvaluator().evaluate(eventsPerStream, true, statementContext)).toString()); 
     80                BigDecimal X = new BigDecimal(((Number) expressionX.getExprEvaluator().evaluate(eventsPerStream, true, agentInstanceContext)).toString()); 
    6981                BigDecimal Y; 
    7082                if(isDouble) 
    71                   Y = new BigDecimal(((Number) expressionY.getExprEvaluator().evaluate(eventsPerStream, true, statementContext)).doubleValue()); 
     83                  Y = new BigDecimal(((Number) expressionY.getExprEvaluator().evaluate(eventsPerStream, true, agentInstanceContext)).doubleValue()); 
    7284                else 
    73                   Y = new BigDecimal(((Number) expressionY.getExprEvaluator().evaluate(eventsPerStream, true, statementContext)).toString()); 
     85                  Y = new BigDecimal(((Number) expressionY.getExprEvaluator().evaluate(eventsPerStream, true, agentInstanceContext)).toString()); 
    7486                statisticsBean.addPoint(X, Y); 
    7587            } 
     
    8294            { 
    8395                eventsPerStream[0] = oldData[i]; 
    84                 BigDecimal X = new BigDecimal(((Number) expressionX.getExprEvaluator().evaluate(eventsPerStream, true, statementContext)).toString()); 
     96                BigDecimal X = new BigDecimal(((Number) expressionX.getExprEvaluator().evaluate(eventsPerStream, true, agentInstanceContext)).toString()); 
    8597                BigDecimal Y; 
    8698                if(isDouble) 
    87                   Y = new BigDecimal(((Number) expressionY.getExprEvaluator().evaluate(eventsPerStream, true, statementContext)).doubleValue()); 
     99                  Y = new BigDecimal(((Number) expressionY.getExprEvaluator().evaluate(eventsPerStream, true, agentInstanceContext)).doubleValue()); 
    88100                else 
    89                   Y = new BigDecimal(((Number) expressionY.getExprEvaluator().evaluate(eventsPerStream, true, statementContext)).toString()); 
     101                  Y = new BigDecimal(((Number) expressionY.getExprEvaluator().evaluate(eventsPerStream, true, agentInstanceContext)).toString()); 
    90102                statisticsBean.removePoint(X, Y); 
    91103            } 
     
    96108            { 
    97109                ExactRegressionBean newValues = (ExactRegressionBean) statisticsBean.clone(); 
    98                 EventBean newValuesEvent = statementContext.getEventAdapterService().adapterForBean(newValues); 
    99                 EventBean oldValuesEvent = statementContext.getEventAdapterService().adapterForBean(oldValues); 
     110                EventBean newValuesEvent = agentInstanceContext.getStatementContext().getEventAdapterService().adapterForBean(newValues); 
     111                EventBean oldValuesEvent = agentInstanceContext.getStatementContext().getEventAdapterService().adapterForBean(oldValues); 
    100112                updateChildren(new EventBean[] {newValuesEvent}, new EventBean[] {oldValuesEvent}); 
    101113                lastNewEvent = newValuesEvent; 
     
    104116            { 
    105117                ExactRegressionBean newValues = (ExactRegressionBean) statisticsBean.clone(); 
    106                 EventBean newValuesEvent = statementContext.getEventAdapterService().adapterForBean(newValues); 
     118                EventBean newValuesEvent = agentInstanceContext.getStatementContext().getEventAdapterService().adapterForBean(newValues); 
    107119                updateChildren(new EventBean[] {newValuesEvent}, new EventBean[] {lastNewEvent}); 
    108120                lastNewEvent = newValuesEvent; 
     
    113125    public final Iterator<EventBean> iterator() 
    114126    { 
    115         return new SingleEventIterator(statementContext.getEventAdapterService().adapterForBean(statisticsBean)); 
     127        return new SingleEventIterator(agentInstanceContext.getStatementContext().getEventAdapterService().adapterForBean(statisticsBean)); 
    116128    } 
    117129 
  • src/java/com/omniti/reconnoiter/esper/ExactRegressionLinestView.java

    r69c4c69 r2750200  
    1111package com.omniti.reconnoiter.esper; 
    1212 
     13import com.espertech.esper.client.EventBean; 
    1314import com.espertech.esper.client.EventType; 
    14 import com.espertech.esper.core.StatementContext; 
     15import com.espertech.esper.core.context.util.AgentInstanceContext; 
     16import com.espertech.esper.core.service.StatementContext; 
     17import com.espertech.esper.epl.expression.ExprNode; 
     18import com.espertech.esper.event.EventAdapterService; 
    1519import com.espertech.esper.view.CloneableView; 
    1620import com.espertech.esper.view.View; 
    17 import com.espertech.esper.epl.expression.ExprNode; 
     21import com.espertech.esper.view.ViewFieldEnum; 
     22import com.espertech.esper.view.stat.StatViewAdditionalProps; 
     23import com.espertech.esper.view.stat.BaseStatisticsBean; 
     24 
     25import java.util.HashMap; 
     26import java.util.Map; 
    1827 
    1928public final class ExactRegressionLinestView extends ExactBaseBivariateStatisticsView implements CloneableView 
     
    2130    private EventType eventType; 
    2231 
    23     public ExactRegressionLinestView(StatementContext statementContext, ExprNode xFieldName, ExprNode yFieldName
     32    public ExactRegressionLinestView(AgentInstanceContext agentInstanceContext, ExprNode xFieldName, ExprNode yFieldName, EventType eventType, StatViewAdditionalProps additionalProps
    2433    { 
    25         super(statementContext, new ExactRegressionBean(), xFieldName, yFieldName); 
     34        super(agentInstanceContext, xFieldName, yFieldName, eventType, additionalProps); 
    2635    } 
    2736 
    28     public View cloneView(StatementContext statementContext
     37    public View cloneView(
    2938    { 
    30         return new ExactRegressionLinestView(statementContext, this.getExpressionX(), this.getExpressionY()); 
     39        return new ExactRegressionLinestView(agentInstanceContext, this.getExpressionX(), this.getExpressionY(), eventType, additionalProps); 
    3140    } 
    3241 
     
    3847    public EventType getEventType() 
    3948    { 
    40         return getEventType(statementContext.getEventAdapterService()); 
     49        return getEventType(agentInstanceContext.getStatementContext().getEventAdapterService()); 
    4150    } 
    4251 
     
    4756                " fieldY=" + this.getExpressionY(); 
    4857    } 
     58 
     59    public static EventBean doPopulateMap(BaseStatisticsBean baseStatisticsBean, 
     60                                         EventAdapterService eventAdapterService, 
     61                                         EventType eventType, 
     62                                         StatViewAdditionalProps additionalProps, 
     63                                         Object[] decoration) 
     64    { 
     65        Map<String, Object> result = new HashMap<String, Object>(); 
     66        result.put(ViewFieldEnum.REGRESSION__SLOPE.getName(), baseStatisticsBean.getSlope()); 
     67        result.put(ViewFieldEnum.REGRESSION__YINTERCEPT.getName(), baseStatisticsBean.getYIntercept()); 
     68        result.put(ViewFieldEnum.REGRESSION__XAVERAGE.getName(), baseStatisticsBean.getXAverage()); 
     69        result.put(ViewFieldEnum.REGRESSION__XSTANDARDDEVIATIONPOP.getName(), baseStatisticsBean.getXStandardDeviationPop()); 
     70        result.put(ViewFieldEnum.REGRESSION__XSTANDARDDEVIATIONSAMPLE.getName(), baseStatisticsBean.getXStandardDeviationSample()); 
     71        result.put(ViewFieldEnum.REGRESSION__XSUM.getName(), baseStatisticsBean.getXSum()); 
     72        result.put(ViewFieldEnum.REGRESSION__XVARIANCE.getName(), baseStatisticsBean.getXVariance()); 
     73        result.put(ViewFieldEnum.REGRESSION__YAVERAGE.getName(), baseStatisticsBean.getYAverage()); 
     74        result.put(ViewFieldEnum.REGRESSION__YSTANDARDDEVIATIONPOP.getName(), baseStatisticsBean.getYStandardDeviationPop()); 
     75        result.put(ViewFieldEnum.REGRESSION__YSTANDARDDEVIATIONSAMPLE.getName(), baseStatisticsBean.getYStandardDeviationSample()); 
     76        result.put(ViewFieldEnum.REGRESSION__YSUM.getName(), baseStatisticsBean.getYSum()); 
     77        result.put(ViewFieldEnum.REGRESSION__YVARIANCE.getName(), baseStatisticsBean.getYVariance()); 
     78        result.put(ViewFieldEnum.REGRESSION__DATAPOINTS.getName(), baseStatisticsBean.getDataPoints()); 
     79        result.put(ViewFieldEnum.REGRESSION__N.getName(), baseStatisticsBean.getN()); 
     80        result.put(ViewFieldEnum.REGRESSION__SUMX.getName(), baseStatisticsBean.getSumX()); 
     81        result.put(ViewFieldEnum.REGRESSION__SUMXSQ.getName(), baseStatisticsBean.getSumXSq()); 
     82        result.put(ViewFieldEnum.REGRESSION__SUMXY.getName(), baseStatisticsBean.getSumXY()); 
     83        result.put(ViewFieldEnum.REGRESSION__SUMY.getName(), baseStatisticsBean.getSumY()); 
     84        result.put(ViewFieldEnum.REGRESSION__SUMYSQ.getName(), baseStatisticsBean.getSumYSq()); 
     85        if (additionalProps != null) { 
     86            additionalProps.addProperties(result, decoration); 
     87        } 
     88        return eventAdapterService.adapterForTypedMap(result, eventType); 
     89    } 
     90 
     91    protected static EventType createEventType(StatementContext statementContext, StatViewAdditionalProps additionalProps, int streamNum) 
     92    { 
     93        Map<String, Object> eventTypeMap = new HashMap<String, Object>(); 
     94        eventTypeMap.put(ViewFieldEnum.REGRESSION__SLOPE.getName(), Double.class); 
     95        eventTypeMap.put(ViewFieldEnum.REGRESSION__YINTERCEPT.getName(), Double.class); 
     96        eventTypeMap.put(ViewFieldEnum.REGRESSION__XAVERAGE.getName(), Double.class); 
     97        eventTypeMap.put(ViewFieldEnum.REGRESSION__XSTANDARDDEVIATIONPOP.getName(), Double.class); 
     98        eventTypeMap.put(ViewFieldEnum.REGRESSION__XSTANDARDDEVIATIONSAMPLE.getName(), Double.class); 
     99        eventTypeMap.put(ViewFieldEnum.REGRESSION__XSUM.getName(), Double.class); 
     100        eventTypeMap.put(ViewFieldEnum.REGRESSION__XVARIANCE.getName(), Double.class); 
     101        eventTypeMap.put(ViewFieldEnum.REGRESSION__YAVERAGE.getName(), Double.class); 
     102        eventTypeMap.put(ViewFieldEnum.REGRESSION__YSTANDARDDEVIATIONPOP.getName(), Double.class); 
     103        eventTypeMap.put(ViewFieldEnum.REGRESSION__YSTANDARDDEVIATIONSAMPLE.getName(), Double.class); 
     104        eventTypeMap.put(ViewFieldEnum.REGRESSION__YSUM.getName(), Double.class); 
     105        eventTypeMap.put(ViewFieldEnum.REGRESSION__YVARIANCE.getName(), Double.class); 
     106        eventTypeMap.put(ViewFieldEnum.REGRESSION__DATAPOINTS.getName(), Long.class); 
     107        eventTypeMap.put(ViewFieldEnum.REGRESSION__N.getName(), Long.class); 
     108        eventTypeMap.put(ViewFieldEnum.REGRESSION__SUMX.getName(), Double.class); 
     109        eventTypeMap.put(ViewFieldEnum.REGRESSION__SUMXSQ.getName(), Double.class); 
     110        eventTypeMap.put(ViewFieldEnum.REGRESSION__SUMXY.getName(), Double.class); 
     111        eventTypeMap.put(ViewFieldEnum.REGRESSION__SUMY.getName(), Double.class); 
     112        eventTypeMap.put(ViewFieldEnum.REGRESSION__SUMYSQ.getName(), Double.class); 
     113        StatViewAdditionalProps.addCheckDupProperties(eventTypeMap, additionalProps, 
     114                ViewFieldEnum.REGRESSION__SLOPE, ViewFieldEnum.REGRESSION__YINTERCEPT); 
     115        String outputEventTypeName = statementContext.getStatementId() + "_regview_" + streamNum; 
     116        return statementContext.getEventAdapterService().createAnonymousMapType(outputEventTypeName, eventTypeMap); 
     117    } 
    49118} 
    50119 
  • src/java/com/omniti/reconnoiter/esper/ExactStatViewFactory.java

    r69c4c69 r2750200  
    1717import com.espertech.esper.view.ViewFactory; 
    1818import com.espertech.esper.view.View; 
    19 import com.espertech.esper.core.StatementContext; 
     19import com.espertech.esper.view.stat.StatViewAdditionalProps; 
     20import com.espertech.esper.core.service.StatementContext; 
     21import com.espertech.esper.core.context.util.AgentInstanceViewFactoryChainContext; 
    2022 
    2123public class ExactStatViewFactory extends ViewFactorySupport { 
    2224    private ViewFactoryContext viewFactoryContext; 
    2325    private List<ExprNode> viewParameters; 
     26    private int streamNumber; 
    2427    private ExprNode timestampExpression; 
    2528    private ExprNode valueExpression; 
     29    protected EventType eventType; 
     30    protected StatViewAdditionalProps additionalProps; 
    2631 
    2732    public void setViewParameters(ViewFactoryContext viewFactoryContext,  
     
    3338        } 
    3439        this.viewParameters = viewParameters; 
     40        this.streamNumber = viewFactoryContext.getStreamNum(); 
    3541    } 
    3642 
     
    5864                "View requires long-typed or double-typed values for in parameter 2"); 
    5965        } 
     66 
     67        additionalProps = StatViewAdditionalProps.make(validatedNodes, 2, parentEventType); 
     68        eventType = ExactRegressionLinestView.createEventType(statementContext, additionalProps, streamNumber); 
    6069    } 
    61     public View makeView(StatementContext statementContext) { 
    62         return new ExactRegressionLinestView(statementContext, timestampExpression, valueExpression); 
     70 
     71    public View makeView(AgentInstanceViewFactoryChainContext agentInstanceViewFactoryContext) { 
     72        return new ExactRegressionLinestView(agentInstanceViewFactoryContext.getAgentInstanceContext(), timestampExpression, valueExpression, eventType, additionalProps); 
    6373    } 
    6474 
  • src/java/run-iep.sh.in

    r0238329 r2750200  
    1414fi 
    1515JARS="reconnoiter.jar activemq-all-5.2.0.jar antlr-runtime-3.1.1.jar \ 
    16         esper-4.1.0.jar log4j-1.2.15.jar \ 
     16        esper-4.5.0.jar log4j-1.2.15.jar \ 
    1717        spring-beans-2.5.5.jar spring-context-2.5.5.jar \ 
    1818        cglib-nodep-2.2.jar commons-pool-1.4.jar commons-dbcp-1.2.2.jar \