当前位置: 首页>>代码示例>>Java>>正文


Java OutputProcessViewFactory类代码示例

本文整理汇总了Java中com.espertech.esper.epl.view.OutputProcessViewFactory的典型用法代码示例。如果您正苦于以下问题:Java OutputProcessViewFactory类的具体用法?Java OutputProcessViewFactory怎么用?Java OutputProcessViewFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OutputProcessViewFactory类属于com.espertech.esper.epl.view包,在下文中一共展示了OutputProcessViewFactory类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: StatementAgentInstanceFactoryOnTriggerTable

import com.espertech.esper.epl.view.OutputProcessViewFactory; //导入依赖的package包/类
public StatementAgentInstanceFactoryOnTriggerTable(StatementContext statementContext, StatementSpecCompiled statementSpec, EPServicesContext services, ViewableActivator activator, SubSelectStrategyCollection subSelectStrategyCollection, ResultSetProcessorFactoryDesc resultSetProcessorPrototype, ExprNode validatedJoin, TableOnViewFactory onExprFactory, EventType activatorResultEventType, TableMetadata tableMetadata, ResultSetProcessorFactoryDesc outputResultSetProcessorPrototype, OutputProcessViewFactory outputProcessViewFactory)
        throws ExprValidationException {
    super(statementContext, statementSpec, services, activator, subSelectStrategyCollection);
    this.resultSetProcessorPrototype = resultSetProcessorPrototype;
    this.onExprFactory = onExprFactory;
    this.outputResultSetProcessorPrototype = outputResultSetProcessorPrototype;
    this.outputProcessViewFactory = outputProcessViewFactory;

    StatementAgentInstanceFactoryOnTriggerNamedWindow.IndexHintPair pair = StatementAgentInstanceFactoryOnTriggerNamedWindow.getIndexHintPair(statementContext, statementSpec);
    IndexHint indexHint = pair.getIndexHint();
    ExcludePlanHint excludePlanHint = pair.getExcludePlanHint();

    queryPlanResult = SubordinateQueryPlanner.planOnExpression(
            validatedJoin, activatorResultEventType, indexHint, true, -1, excludePlanHint,
            false, tableMetadata.getEventTableIndexMetadataRepo(), tableMetadata.getInternalEventType(),
            tableMetadata.getUniqueKeyProps(), true, statementContext.getStatementName(), statementContext.getStatementId(), statementContext.getAnnotations(), statementContext.getEngineImportService());
    if (queryPlanResult.getIndexDescs() != null) {
        for (int i = 0; i < queryPlanResult.getIndexDescs().length; i++) {
            tableMetadata.addIndexReference(queryPlanResult.getIndexDescs()[i].getIndexName(), statementContext.getStatementName());
        }
    }
    SubordinateQueryPlannerUtil.queryPlanLogOnExpr(tableMetadata.isQueryPlanLogging(), TableServiceImpl.getQueryPlanLog(),
            queryPlanResult, statementContext.getAnnotations(), statementContext.getEngineImportService());
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:25,代码来源:StatementAgentInstanceFactoryOnTriggerTable.java

示例2: StatementAgentInstanceFactoryCreateWindow

import com.espertech.esper.epl.view.OutputProcessViewFactory; //导入依赖的package包/类
public StatementAgentInstanceFactoryCreateWindow(StatementContext statementContext, StatementSpecCompiled statementSpec, EPServicesContext services, ViewableActivator activator, ViewFactoryChain unmaterializedViewChain, ResultSetProcessorFactoryDesc resultSetProcessorPrototype, OutputProcessViewFactory outputProcessViewFactory, boolean recoveringStatement) {
    super(statementContext.getAnnotations());
    this.statementContext = statementContext;
    this.statementSpec = statementSpec;
    this.services = services;
    this.activator = activator;
    this.unmaterializedViewChain = unmaterializedViewChain;
    this.resultSetProcessorPrototype = resultSetProcessorPrototype;
    this.outputProcessViewFactory = outputProcessViewFactory;
    isRecoveringStatement = recoveringStatement;

    if (statementSpec.getCreateWindowDesc().getInsertFilter() != null) {
        createWindowInsertFilter = ExprNodeCompiler.allocateEvaluator(statementSpec.getCreateWindowDesc().getInsertFilter().getForge(), statementContext.getEngineImportService(), StatementAgentInstanceFactoryCreateWindow.class, false, statementContext.getStatementName());
    } else {
        createWindowInsertFilter = null;
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:18,代码来源:StatementAgentInstanceFactoryCreateWindow.java

示例3: StatementAgentInstanceFactorySelect

import com.espertech.esper.epl.view.OutputProcessViewFactory; //导入依赖的package包/类
public StatementAgentInstanceFactorySelect(int numStreams, ViewableActivator[] eventStreamParentViewableActivators, StatementContext statementContext, StatementSpecCompiled statementSpec, EPServicesContext services, StreamTypeService typeService, ViewFactoryChain[] unmaterializedViewChain, ResultSetProcessorFactoryDesc resultSetProcessorFactoryDesc, StreamJoinAnalysisResult joinAnalysisResult, boolean recoveringResilient, JoinSetComposerPrototype joinSetComposerPrototype, SubSelectStrategyCollection subSelectStrategyCollection, ViewResourceDelegateVerified viewResourceDelegate, OutputProcessViewFactory outputProcessViewFactory) {
    super(statementSpec.getAnnotations());
    this.numStreams = numStreams;
    this.eventStreamParentViewableActivators = eventStreamParentViewableActivators;
    this.statementContext = statementContext;
    this.statementSpec = statementSpec;
    this.services = services;
    this.typeService = typeService;
    this.unmaterializedViewChain = unmaterializedViewChain;
    this.resultSetProcessorFactoryDesc = resultSetProcessorFactoryDesc;
    this.joinAnalysisResult = joinAnalysisResult;
    this.joinSetComposerPrototype = joinSetComposerPrototype;
    this.subSelectStrategyCollection = subSelectStrategyCollection;
    this.viewResourceDelegate = viewResourceDelegate;
    this.outputProcessViewFactory = outputProcessViewFactory;

    if (statementSpec.getFilterRootNode() != null) {
        filterRootNodeEvaluator = ExprNodeCompiler.allocateEvaluator(statementSpec.getFilterRootNode().getForge(), statementContext.getEngineImportService(), StatementAgentInstanceFactorySelect.class, false, statementContext.getStatementName());
    } else {
        filterRootNodeEvaluator = null;
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:23,代码来源:StatementAgentInstanceFactorySelect.java

示例4: newContextInternal

import com.espertech.esper.epl.view.OutputProcessViewFactory; //导入依赖的package包/类
public StatementAgentInstanceFactoryCreateVariableResult newContextInternal(final AgentInstanceContext agentInstanceContext, boolean isRecoveringResilient) {
    StopCallback stopCallback = new StopCallback() {
        public void stop() {
            services.getVariableService().deallocateVariableState(variableMetaData.getVariableName(), agentInstanceContext.getAgentInstanceId());
        }
    };
    services.getVariableService().allocateVariableState(variableMetaData.getVariableName(), agentInstanceContext.getAgentInstanceId(), statementContext.getStatementExtensionServicesContext(), isRecoveringResilient);

    final CreateVariableView createView = new CreateVariableView(statementContext.getStatementId(), services.getEventAdapterService(), services.getVariableService(), createDesc.getVariableName(), statementContext.getStatementResultService(), agentInstanceContext.getAgentInstanceId());

    services.getVariableService().registerCallback(createDesc.getVariableName(), agentInstanceContext.getAgentInstanceId(), createView);
    statementContext.getStatementStopService().addSubscriber(new StatementStopCallback() {
        public void statementStopped() {
            services.getVariableService().unregisterCallback(createDesc.getVariableName(), 0, createView);
        }
    });

    // Create result set processor, use wildcard selection
    statementSpec.getSelectClauseSpec().setSelectExprList(new SelectClauseElementWildcard());
    statementSpec.setSelectStreamDirEnum(SelectClauseStreamSelectorEnum.RSTREAM_ISTREAM_BOTH);
    StreamTypeService typeService = new StreamTypeServiceImpl(new EventType[]{createView.getEventType()}, new String[]{"create_variable"}, new boolean[]{true}, services.getEngineURI(), false, false);
    OutputProcessViewBase outputViewBase;
    try {
        ResultSetProcessorFactoryDesc resultSetProcessorPrototype = ResultSetProcessorFactoryFactory.getProcessorPrototype(
                statementSpec, statementContext, typeService, null, new boolean[0], true, ContextPropertyRegistryImpl.EMPTY_REGISTRY, null, services.getConfigSnapshot(), services.getResultSetProcessorHelperFactory(), false, false);
        ResultSetProcessor resultSetProcessor = EPStatementStartMethodHelperAssignExpr.getAssignResultSetProcessor(agentInstanceContext, resultSetProcessorPrototype, false, null, false);

        // Attach output view
        OutputProcessViewFactory outputViewFactory = OutputProcessViewFactoryFactory.make(statementSpec, services.getInternalEventRouter(), agentInstanceContext.getStatementContext(), resultSetProcessorPrototype.getResultEventType(), null, services.getTableService(), resultSetProcessorPrototype.getResultSetProcessorType(), services.getResultSetProcessorHelperFactory(), services.getStatementVariableRefService());
        outputViewBase = outputViewFactory.makeView(resultSetProcessor, agentInstanceContext);
        createView.addView(outputViewBase);
    } catch (ExprValidationException ex) {
        throw new EPException("Unexpected exception in create-variable context allocation: " + ex.getMessage(), ex);
    }

    return new StatementAgentInstanceFactoryCreateVariableResult(outputViewBase, stopCallback, agentInstanceContext);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:38,代码来源:StatementAgentInstanceFactoryCreateVariable.java

示例5: StatementAgentInstanceFactoryOnTriggerNamedWindow

import com.espertech.esper.epl.view.OutputProcessViewFactory; //导入依赖的package包/类
public StatementAgentInstanceFactoryOnTriggerNamedWindow(final StatementContext statementContext, StatementSpecCompiled statementSpec, EPServicesContext services, ViewableActivator activator, SubSelectStrategyCollection subSelectStrategyCollection, ResultSetProcessorFactoryDesc resultSetProcessorPrototype, ExprNode validatedJoin, ResultSetProcessorFactoryDesc outputResultSetProcessorPrototype, NamedWindowOnExprFactory onExprFactory, OutputProcessViewFactory outputProcessViewFactory, EventType activatorResultEventType, final NamedWindowProcessor processor, List<StopCallback> stopCallbacks)
        throws ExprValidationException {
    super(statementContext, statementSpec, services, activator, subSelectStrategyCollection);
    this.resultSetProcessorPrototype = resultSetProcessorPrototype;
    this.outputResultSetProcessorPrototype = outputResultSetProcessorPrototype;
    this.onExprFactory = onExprFactory;
    this.outputProcessViewFactory = outputProcessViewFactory;
    this.processor = processor;

    IndexHintPair pair = getIndexHintPair(statementContext, statementSpec);
    IndexHint indexHint = pair.getIndexHint();
    ExcludePlanHint excludePlanHint = pair.getExcludePlanHint();

    queryPlan = SubordinateQueryPlanner.planOnExpression(
            validatedJoin, activatorResultEventType, indexHint, processor.isEnableSubqueryIndexShare(), -1, excludePlanHint,
            processor.isVirtualDataWindow(), processor.getEventTableIndexMetadataRepo(), processor.getNamedWindowType(),
            processor.getOptionalUniqueKeyProps(), false, statementContext.getStatementName(), statementContext.getStatementId(), statementContext.getAnnotations(), statementContext.getEngineImportService());
    if (queryPlan.getIndexDescs() != null) {
        SubordinateQueryPlannerUtil.addIndexMetaAndRef(queryPlan.getIndexDescs(), processor.getEventTableIndexMetadataRepo(), statementContext.getStatementName());
        stopCallbacks.add(new StopCallback() {
            public void stop() {
                for (int i = 0; i < queryPlan.getIndexDescs().length; i++) {
                    boolean last = processor.getEventTableIndexMetadataRepo().removeIndexReference(queryPlan.getIndexDescs()[i].getIndexMultiKey(), statementContext.getStatementName());
                    if (last) {
                        processor.getEventTableIndexMetadataRepo().removeIndex(queryPlan.getIndexDescs()[i].getIndexMultiKey());
                        processor.removeAllInstanceIndexes(queryPlan.getIndexDescs()[i].getIndexMultiKey());
                    }
                }
            }
        });
    }
    SubordinateQueryPlannerUtil.queryPlanLogOnExpr(processor.getRootView().isQueryPlanLogging(), NamedWindowRootView.getQueryPlanLog(),
            queryPlan, statementContext.getAnnotations(), statementContext.getEngineImportService());
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:35,代码来源:StatementAgentInstanceFactoryOnTriggerNamedWindow.java

示例6: handleContextFactoryOnTriggerTable

import com.espertech.esper.epl.view.OutputProcessViewFactory; //导入依赖的package包/类
private ContextFactoryResult handleContextFactoryOnTriggerTable(StatementContext statementContext, EPServicesContext services, OnTriggerWindowDesc onTriggerDesc, String contextName, StreamSpecCompiled streamSpec, ActivatorResult activatorResult, ContextPropertyRegistry contextPropertyRegistry, SubSelectActivationCollection subSelectStreamDesc)
        throws ExprValidationException {
    TableMetadata metadata = services.getTableService().getTableMetadata(onTriggerDesc.getWindowName());

    // validate context
    validateOnExpressionContext(contextName, metadata.getContextName(), "Table '" + onTriggerDesc.getWindowName() + "'");

    InternalEventRouter routerService = null;
    if (statementSpec.getInsertIntoDesc() != null || onTriggerDesc instanceof OnTriggerMergeDesc) {
        routerService = services.getInternalEventRouter();
    }

    // validate expressions and plan subselects
    TriggerValidationPlanResult validationResult = validateOnTriggerPlan(services, statementContext, onTriggerDesc, metadata.getInternalEventType(), streamSpec, activatorResult, contextPropertyRegistry, subSelectStreamDesc, metadata.getTableName());

    // table on-action view factory
    TableOnViewFactory onExprFactory = TableOnViewFactoryFactory.make(metadata, onTriggerDesc, activatorResult.activatorResultEventType, streamSpec.getOptionalStreamName(),
            statementContext, statementContext.getEpStatementHandle().getMetricsHandle(), false, routerService);

    // For on-delete/set/update/merge, create an output processor that passes on as a wildcard the underlying event
    ResultSetProcessorFactoryDesc outputResultSetProcessorPrototype = null;
    if ((statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_DELETE) ||
            (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_UPDATE) ||
            (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_MERGE)) {
        StatementSpecCompiled defaultSelectAllSpec = new StatementSpecCompiled();
        defaultSelectAllSpec.getSelectClauseSpec().setSelectExprList(new SelectClauseElementWildcard());
        // we'll be expecting public-type events as there is no copy op
        StreamTypeService streamTypeService = new StreamTypeServiceImpl(new EventType[]{metadata.getPublicEventType()}, new String[]{"trigger_stream"}, new boolean[]{true}, services.getEngineURI(), false, false);
        outputResultSetProcessorPrototype = ResultSetProcessorFactoryFactory.getProcessorPrototype(defaultSelectAllSpec, statementContext, streamTypeService, null, new boolean[0], true, contextPropertyRegistry, null, services.getConfigSnapshot(), services.getResultSetProcessorHelperFactory(), false, true);
    }

    EventType resultEventType = validationResult.resultSetProcessorPrototype.getResultEventType();
    OutputProcessViewFactory outputViewFactory = OutputProcessViewFactoryFactory.make(statementSpec, services.getInternalEventRouter(), statementContext, resultEventType, null, services.getTableService(), validationResult.resultSetProcessorPrototype.getResultSetProcessorType(), services.getResultSetProcessorHelperFactory(), services.getStatementVariableRefService());

    StatementAgentInstanceFactoryOnTriggerTable contextFactory = new StatementAgentInstanceFactoryOnTriggerTable(statementContext, statementSpec, services, activatorResult.activator, validationResult.getSubSelectStrategyCollection(), validationResult.getResultSetProcessorPrototype(), validationResult.validatedJoin, onExprFactory, activatorResult.activatorResultEventType, metadata, outputResultSetProcessorPrototype, outputViewFactory);

    return new ContextFactoryResult(contextFactory, validationResult.getSubSelectStrategyCollection(), validationResult.resultSetProcessorPrototype);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:39,代码来源:EPStatementStartMethodOnTrigger.java

示例7: StatementAgentInstanceFactoryOnTrigger

import com.espertech.esper.epl.view.OutputProcessViewFactory; //导入依赖的package包/类
public StatementAgentInstanceFactoryOnTrigger(StatementContext statementContext, StatementSpecCompiled statementSpec, EPServicesContext services, ViewableActivator activator, SubSelectStrategyCollection subSelectStrategyCollection, ResultSetProcessorFactoryDesc resultSetProcessorPrototype, ExprNode validatedJoin, EventType activatorResultEventType, StatementAgentInstanceFactoryOnTriggerSplitDesc splitDesc, ResultSetProcessorFactoryDesc outputResultSetProcessorPrototype, OnSetVariableViewFactory onSetVariableViewFactory, NamedWindowOnExprFactory onExprFactory, OutputProcessViewFactory outputProcessViewFactory, boolean recoveringStatement) {
    this.statementContext = statementContext;
    this.statementSpec = statementSpec;
    this.services = services;
    this.activator = activator;
    this.subSelectStrategyCollection = subSelectStrategyCollection;
    this.resultSetProcessorPrototype = resultSetProcessorPrototype;
    this.validatedJoin = validatedJoin;
    this.activatorResultEventType = activatorResultEventType;
    this.splitDesc = splitDesc;
    this.outputResultSetProcessorPrototype = outputResultSetProcessorPrototype;
    this.onSetVariableViewFactory = onSetVariableViewFactory;
    this.onExprFactory = onExprFactory;
    this.outputProcessViewFactory = outputProcessViewFactory;
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:16,代码来源:StatementAgentInstanceFactoryOnTrigger.java

示例8: StatementAgentInstanceFactoryCreateWindow

import com.espertech.esper.epl.view.OutputProcessViewFactory; //导入依赖的package包/类
public StatementAgentInstanceFactoryCreateWindow(StatementContext statementContext, StatementSpecCompiled statementSpec, EPServicesContext services, ViewableActivatorFilterProxy activator, ViewFactoryChain unmaterializedViewChain, ResultSetProcessorFactoryDesc resultSetProcessorPrototype, OutputProcessViewFactory outputProcessViewFactory, boolean recoveringStatement) {
    this.statementContext = statementContext;
    this.statementSpec = statementSpec;
    this.services = services;
    this.activator = activator;
    this.unmaterializedViewChain = unmaterializedViewChain;
    this.resultSetProcessorPrototype = resultSetProcessorPrototype;
    this.outputProcessViewFactory = outputProcessViewFactory;
    isRecoveringStatement = recoveringStatement;
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:11,代码来源:StatementAgentInstanceFactoryCreateWindow.java

示例9: StatementAgentInstanceFactorySelect

import com.espertech.esper.epl.view.OutputProcessViewFactory; //导入依赖的package包/类
public StatementAgentInstanceFactorySelect(int numStreams, ViewableActivator[] eventStreamParentViewableActivators, StatementContext statementContext, StatementSpecCompiled statementSpec, EPServicesContext services, StreamTypeService typeService, ViewFactoryChain[] unmaterializedViewChain, ResultSetProcessorFactoryDesc resultSetProcessorFactoryDesc, StreamJoinAnalysisResult joinAnalysisResult, boolean recoveringResilient, JoinSetComposerPrototype joinSetComposerPrototype, SubSelectStrategyCollection subSelectStrategyCollection, ViewResourceDelegateVerified viewResourceDelegate, OutputProcessViewFactory outputProcessViewFactory) {
    this.numStreams = numStreams;
    this.eventStreamParentViewableActivators = eventStreamParentViewableActivators;
    this.statementContext = statementContext;
    this.statementSpec = statementSpec;
    this.services = services;
    this.typeService = typeService;
    this.unmaterializedViewChain = unmaterializedViewChain;
    this.resultSetProcessorFactoryDesc = resultSetProcessorFactoryDesc;
    this.joinAnalysisResult = joinAnalysisResult;
    this.joinSetComposerPrototype = joinSetComposerPrototype;
    this.subSelectStrategyCollection = subSelectStrategyCollection;
    this.viewResourceDelegate = viewResourceDelegate;
    this.outputProcessViewFactory = outputProcessViewFactory;
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:16,代码来源:StatementAgentInstanceFactorySelect.java

示例10: getOutputProcessViewFactory

import com.espertech.esper.epl.view.OutputProcessViewFactory; //导入依赖的package包/类
public OutputProcessViewFactory getOutputProcessViewFactory() {
    return outputProcessViewFactory;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:StatementAgentInstanceFactorySelect.java

示例11: StatementAgentInstanceFactoryOnTriggerSetVariable

import com.espertech.esper.epl.view.OutputProcessViewFactory; //导入依赖的package包/类
public StatementAgentInstanceFactoryOnTriggerSetVariable(StatementContext statementContext, StatementSpecCompiled statementSpec, EPServicesContext services, ViewableActivator activator, SubSelectStrategyCollection subSelectStrategyCollection, OnSetVariableViewFactory onSetVariableViewFactory, ResultSetProcessorFactoryDesc outputResultSetProcessorPrototype, OutputProcessViewFactory outputProcessViewFactory) {
    super(statementContext, statementSpec, services, activator, subSelectStrategyCollection);
    this.onSetVariableViewFactory = onSetVariableViewFactory;
    this.outputResultSetProcessorPrototype = outputResultSetProcessorPrototype;
    this.outputProcessViewFactory = outputProcessViewFactory;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:7,代码来源:StatementAgentInstanceFactoryOnTriggerSetVariable.java

示例12: handleContextFactoryOnTriggerNamedWindow

import com.espertech.esper.epl.view.OutputProcessViewFactory; //导入依赖的package包/类
private ContextFactoryResult handleContextFactoryOnTriggerNamedWindow(EPServicesContext services, StatementContext statementContext, OnTriggerWindowDesc onTriggerDesc, String contextName, StreamSpecCompiled streamSpec, ContextPropertyRegistry contextPropertyRegistry, SubSelectActivationCollection subSelectStreamDesc, ActivatorResult activatorResult, StreamSelector optionalStreamSelector, List<StopCallback> stopCallbacks)
        throws ExprValidationException {
    NamedWindowProcessor processor = services.getNamedWindowMgmtService().getProcessor(onTriggerDesc.getWindowName());

    // validate context
    validateOnExpressionContext(contextName, processor.getContextName(), "Named window '" + onTriggerDesc.getWindowName() + "'");

    EventType namedWindowType = processor.getNamedWindowType();
    services.getStatementEventTypeRefService().addReferences(statementContext.getStatementName(), new String[]{onTriggerDesc.getWindowName()});

    // validate expressions and plan subselects
    TriggerValidationPlanResult validationResult = validateOnTriggerPlan(services, statementContext, onTriggerDesc, namedWindowType, streamSpec, activatorResult, contextPropertyRegistry, subSelectStreamDesc, null);

    InternalEventRouter routerService = null;
    boolean addToFront = false;
    String optionalInsertIntoTableName = null;
    if (statementSpec.getInsertIntoDesc() != null || onTriggerDesc instanceof OnTriggerMergeDesc) {
        routerService = services.getInternalEventRouter();
    }
    if (statementSpec.getInsertIntoDesc() != null) {
        TableMetadata tableMetadata = services.getTableService().getTableMetadata(statementSpec.getInsertIntoDesc().getEventTypeName());
        if (tableMetadata != null) {
            optionalInsertIntoTableName = tableMetadata.getTableName();
            routerService = null;
        }
        addToFront = statementContext.getNamedWindowMgmtService().isNamedWindow(statementSpec.getInsertIntoDesc().getEventTypeName());
    }
    boolean isDistinct = statementSpec.getSelectClauseSpec().isDistinct();
    EventType selectResultEventType = validationResult.resultSetProcessorPrototype.getResultEventType();
    StatementMetricHandle createNamedWindowMetricsHandle = processor.getCreateNamedWindowMetricsHandle();

    NamedWindowOnExprFactory onExprFactory = NamedWindowOnExprFactoryFactory.make(namedWindowType, onTriggerDesc.getWindowName(), validationResult.zeroStreamAliasName,
            onTriggerDesc,
            activatorResult.activatorResultEventType, streamSpec.getOptionalStreamName(), addToFront, routerService,
            selectResultEventType,
            statementContext, createNamedWindowMetricsHandle, isDistinct, optionalStreamSelector, optionalInsertIntoTableName);

    // For on-delete/set/update/merge, create an output processor that passes on as a wildcard the underlying event
    ResultSetProcessorFactoryDesc outputResultSetProcessorPrototype = null;
    if ((statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_DELETE) ||
            (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_UPDATE) ||
            (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_MERGE)) {
        StatementSpecCompiled defaultSelectAllSpec = new StatementSpecCompiled();
        defaultSelectAllSpec.getSelectClauseSpec().setSelectExprList(new SelectClauseElementWildcard());
        StreamTypeService streamTypeService = new StreamTypeServiceImpl(new EventType[]{namedWindowType}, new String[]{"trigger_stream"}, new boolean[]{true}, services.getEngineURI(), false, false);
        outputResultSetProcessorPrototype = ResultSetProcessorFactoryFactory.getProcessorPrototype(defaultSelectAllSpec, statementContext, streamTypeService, null, new boolean[0], true, contextPropertyRegistry, null, services.getConfigSnapshot(), services.getResultSetProcessorHelperFactory(), false, true);
    }

    EventType resultEventType = validationResult.resultSetProcessorPrototype.getResultEventType();
    OutputProcessViewFactory outputViewFactory = OutputProcessViewFactoryFactory.make(statementSpec, services.getInternalEventRouter(), statementContext, resultEventType, null, services.getTableService(), validationResult.resultSetProcessorPrototype.getResultSetProcessorType(), services.getResultSetProcessorHelperFactory(), services.getStatementVariableRefService());

    StatementAgentInstanceFactoryOnTriggerNamedWindow contextFactory = new StatementAgentInstanceFactoryOnTriggerNamedWindow(statementContext, statementSpec, services, activatorResult.activator, validationResult.subSelectStrategyCollection, validationResult.resultSetProcessorPrototype, validationResult.validatedJoin, outputResultSetProcessorPrototype, onExprFactory, outputViewFactory, activatorResult.activatorResultEventType, processor, stopCallbacks);
    return new ContextFactoryResult(contextFactory, validationResult.subSelectStrategyCollection, validationResult.resultSetProcessorPrototype);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:55,代码来源:EPStatementStartMethodOnTrigger.java


注:本文中的com.espertech.esper.epl.view.OutputProcessViewFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。