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


Java StatementStopCallback类代码示例

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


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

示例1: VAERevisionProcessorDeclared

import com.espertech.esper.view.StatementStopCallback; //导入依赖的package包/类
/**
 * Ctor.
 *
 * @param revisionEventTypeName name
 * @param spec                  specification
 * @param statementStopService  for stop handling
 * @param eventAdapterService   for nested property handling
 * @param eventTypeIdGenerator  id generator
 */
public VAERevisionProcessorDeclared(String revisionEventTypeName, RevisionSpec spec, StatementStopService statementStopService, EventAdapterService eventAdapterService, EventTypeIdGenerator eventTypeIdGenerator) {
    super(spec, revisionEventTypeName, eventAdapterService);

    // on statement stop, remove versions
    statementStopService.addSubscriber(new StatementStopCallback() {
        public void statementStopped() {
            statePerKey.clear();
        }
    });

    this.statePerKey = new HashMap<Object, RevisionStateDeclared>();
    this.baseEventType = spec.getBaseEventType();
    this.fullKeyGetters = PropertyUtility.getGetters(baseEventType, spec.getKeyPropertyNames());

    // sort non-key properties, removing keys
    groups = PropertyUtility.analyzeGroups(spec.getChangesetPropertyNames(), spec.getDeltaTypes(), spec.getDeltaNames());
    Map<String, RevisionPropertyTypeDesc> propertyDesc = createPropertyDescriptors(spec, groups);

    typeDescriptors = PropertyUtility.getPerType(groups, spec.getChangesetPropertyNames(), spec.getKeyPropertyNames());
    EventTypeMetadata metadata = EventTypeMetadata.createValueAdd(revisionEventTypeName, EventTypeMetadata.TypeClass.REVISION);
    revisionEventType = new RevisionEventType(metadata, eventTypeIdGenerator.getTypeId(revisionEventTypeName), propertyDesc, eventAdapterService);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:32,代码来源:VAERevisionProcessorDeclared.java

示例2: VAERevisionProcessorDeclared

import com.espertech.esper.view.StatementStopCallback; //导入依赖的package包/类
/**
 * Ctor.
 * @param revisionEventTypeName name
 * @param spec specification
 * @param statementStopService for stop handling
 * @param eventAdapterService for nested property handling
 */
public VAERevisionProcessorDeclared(String revisionEventTypeName, RevisionSpec spec, StatementStopService statementStopService, EventAdapterService eventAdapterService, EventTypeIdGenerator eventTypeIdGenerator)
{
    super(spec, revisionEventTypeName, eventAdapterService);

    // on statement stop, remove versions
    statementStopService.addSubscriber(new StatementStopCallback() {
        public void statementStopped()
        {
            statePerKey.clear();
        }
    });

    this.statePerKey = new HashMap<Object, RevisionStateDeclared>();
    this.baseEventType = spec.getBaseEventType();
    this.fullKeyGetters = PropertyUtility.getGetters(baseEventType, spec.getKeyPropertyNames());

    // sort non-key properties, removing keys
    groups = PropertyUtility.analyzeGroups(spec.getChangesetPropertyNames(), spec.getDeltaTypes(), spec.getDeltaNames());
    Map<String, RevisionPropertyTypeDesc> propertyDesc = createPropertyDescriptors(spec, groups);

    typeDescriptors = PropertyUtility.getPerType(groups, spec.getChangesetPropertyNames(), spec.getKeyPropertyNames());
    EventTypeMetadata metadata = EventTypeMetadata.createValueAdd(revisionEventTypeName, EventTypeMetadata.TypeClass.REVISION);
    revisionEventType = new RevisionEventType(metadata, eventTypeIdGenerator.getTypeId(revisionEventTypeName), propertyDesc, eventAdapterService);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:32,代码来源:VAERevisionProcessorDeclared.java

示例3: newContextInternal

import com.espertech.esper.view.StatementStopCallback; //导入依赖的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

示例4: SubSelectStrategyFactoryIndexShare

import com.espertech.esper.view.StatementStopCallback; //导入依赖的package包/类
public SubSelectStrategyFactoryIndexShare(final String statementName, int statementId, int subqueryNum, EventType[] outerEventTypesSelect, final NamedWindowProcessor optionalNamedWindowProcessor, TableMetadata optionalTableMetadata, boolean fullTableScan, IndexHint optionalIndexHint, SubordPropPlan joinedPropPlan, ExprEvaluator filterExprEval, AggregationServiceFactoryDesc aggregationServiceFactory, ExprEvaluator[] groupByKeys, TableService tableService, Annotation[] annotations, StatementStopService statementStopService, EngineImportService engineImportService) throws ExprValidationException {
    this.optionalNamedWindowProcessor = optionalNamedWindowProcessor;
    this.optionalTableMetadata = optionalTableMetadata;
    this.filterExprEval = filterExprEval;
    this.aggregationServiceFactory = aggregationServiceFactory;
    this.groupByKeys = groupByKeys;
    this.tableService = tableService;

    boolean isLogging;
    Logger log;
    if (optionalTableMetadata != null) {
        isLogging = optionalTableMetadata.isQueryPlanLogging();
        log = TableServiceImpl.getQueryPlanLog();
        queryPlan = SubordinateQueryPlanner.planSubquery(outerEventTypesSelect, joinedPropPlan, false, fullTableScan, optionalIndexHint, true, subqueryNum,
                false, optionalTableMetadata.getEventTableIndexMetadataRepo(), optionalTableMetadata.getUniqueKeyProps(), true, statementName, statementId, annotations);
        if (queryPlan != null) {
            for (int i = 0; i < queryPlan.getIndexDescs().length; i++) {
                optionalTableMetadata.addIndexReference(queryPlan.getIndexDescs()[i].getIndexName(), statementName);
            }
        }
    } else {
        isLogging = optionalNamedWindowProcessor.getRootView().isQueryPlanLogging();
        log = NamedWindowRootView.getQueryPlanLog();
        queryPlan = SubordinateQueryPlanner.planSubquery(outerEventTypesSelect, joinedPropPlan, false, fullTableScan, optionalIndexHint, true, subqueryNum,
                optionalNamedWindowProcessor.isVirtualDataWindow(), optionalNamedWindowProcessor.getEventTableIndexMetadataRepo(), optionalNamedWindowProcessor.getOptionalUniqueKeyProps(), false, statementName, statementId, annotations);
        if (queryPlan != null && queryPlan.getIndexDescs() != null) {
            SubordinateQueryPlannerUtil.addIndexMetaAndRef(queryPlan.getIndexDescs(), optionalNamedWindowProcessor.getEventTableIndexMetadataRepo(), statementName);
            statementStopService.addSubscriber(new StatementStopCallback() {
                public void statementStopped() {
                    for (int i = 0; i < queryPlan.getIndexDescs().length; i++) {
                        boolean last = optionalNamedWindowProcessor.getEventTableIndexMetadataRepo().removeIndexReference(queryPlan.getIndexDescs()[i].getIndexMultiKey(), statementName);
                        if (last) {
                            optionalNamedWindowProcessor.getEventTableIndexMetadataRepo().removeIndex(queryPlan.getIndexDescs()[i].getIndexMultiKey());
                            optionalNamedWindowProcessor.removeAllInstanceIndexes(queryPlan.getIndexDescs()[i].getIndexMultiKey());
                        }
                    }
                }
            });
        }
    }
    SubordinateQueryPlannerUtil.queryPlanLogOnSubq(isLogging, log, queryPlan, subqueryNum, annotations, engineImportService);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:43,代码来源:SubSelectStrategyFactoryIndexShare.java


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